From 49dbf1f60dc5c6bcb6b3ffadf89e7e0c14106638 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 10 Aug 2018 07:00:06 +0100 Subject: Pearl: Require width or height to be at least 6 for Tricky 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. References: https://bugs.debian.org/667963 --- pearl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pearl.c b/pearl.c index 4817416..e53b4da 100644 --- a/pearl.c +++ b/pearl.c @@ -274,6 +274,8 @@ static const char *validate_params(const game_params *params, bool 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; } -- cgit v1.1