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
This commit is contained in:
Ben Hutchings
2018-08-10 07:00:06 +01:00
committed by Simon Tatham
parent 387d323dd8
commit 49dbf1f60d

View File

@ -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;
}