On Sat, 2012-04-07 at 10:49 -0700, Josh Triplett wrote:
> Package: sgt-puzzles
> Version: 9411-1
> Severity: normal
> 
> If I ask pearl to generate a 5x5 tricky puzzle, it runs forever.

Indeed.  We have to either enforce a larger size or fudge the difficulty
level in this case.  Attaching my proposed change.

Ben.

-- 
Ben Hutchings
If more than one person is responsible for a bug, no one is at fault.
Author: Ben Hutchings <[email protected]>
Description: pearl: Require width or height to be at least 6 for Tricky
Bug-Debian: http://bugs.debian.org/667963

Josh Triplett reported:
> If I ask pearl to generate a 5x5 tricky puzzle, it runs forever.

I find that 5x6 or 6x5 works, so set the minimum accordingly.

--- sgt-puzzles.orig/pearl.c
+++ sgt-puzzles/pearl.c
@@ -280,6 +280,8 @@
     if (params->h < 5) return "Height must be at least five";
     if (params->difficulty < 0 || params->difficulty >= DIFFCOUNT)
         return "Unknown difficulty level";
+    if (params->difficulty >= DIFF_TRICKY && params->w + params->h < 11)
+	return "Width or height must be at least six for Tricky";
 
     return NULL;
 }

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to