From: Ben Hutchings Date: Tue, 17 Jan 2017 23:57:33 +0000 (+0000) Subject: _fix-pearl-min-dimensions X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=844915a8280a8733cbd9aa04274aa81e57af6c5b;p=sgt-puzzles.git _fix-pearl-min-dimensions 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. Gbp-Pq: Name 102_fix-pearl-min-dimensions.diff --- diff --git a/pearl.c b/pearl.c index 4e4290e..748679d 100644 --- a/pearl.c +++ b/pearl.c @@ -279,6 +279,8 @@ static char *validate_params(const game_params *params, int full) 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; }