shithub: puzzles

Download patch

ref: 8e74bbae6b12fbf0afe155b9ba3b8329426583d4
parent: 50b6e0d7087b6b9b4bc64f279e0ae424f1a24f6b
author: Simon Tatham <anakin@pobox.com>
date: Fri Apr 2 03:21:34 EDT 2010

Dylan O'Donnell reports that Signpost hangs on trying to generate a
2x2 puzzle. Rule it out in validate_params().

[originally from svn r8913]

--- a/signpost.c
+++ b/signpost.c
@@ -423,6 +423,8 @@
 {
     if (params->w < 2 || params->h < 2)
 	return "Width and height must both be at least two";
+    if (params->w == 2 && params->h == 2)   /* leads to generation hang */
+	return "Width and height cannot both be two";
 
     return NULL;
 }