chiark / gitweb /
sgt-puzzles (20161228.7cae89f-1) unstable; urgency=medium
[sgt-puzzles.git] / debian / patches / 102_fix-pearl-min-dimensions.diff
1 Author: Ben Hutchings <ben@decadent.org.uk>
2 Description: pearl: Require width or height to be at least 6 for Tricky
3 Bug-Debian: https://bugs.debian.org/667963
4
5 Josh Triplett reported:
6 > If I ask pearl to generate a 5x5 tricky puzzle, it runs forever.
7
8 I find that 5x6 or 6x5 works, so set the minimum accordingly.
9
10 --- a/pearl.c
11 +++ b/pearl.c
12 @@ -279,6 +279,8 @@ static char *validate_params(const game_
13      if (params->h < 5) return "Height must be at least five";
14      if (params->difficulty < 0 || params->difficulty >= DIFFCOUNT)
15          return "Unknown difficulty level";
16 +    if (params->difficulty >= DIFF_TRICKY && params->w + params->h < 11)
17 +       return "Width or height must be at least six for Tricky";
18  
19      return NULL;
20  }