mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
magnets: Area constraints; fix message.
(The restriction on 2x2 puzzles is because the board layer-out doesn't use neutral pieces on such small boards, and the only soluble 2x2 boards have neutral pieces. I haven't investigated the Tricky size limit, but it seems entirely reasonable that all the smaller boards are too easy. --bjh21) (cherry picked from Android port, commit 133794977a13767e0c1596be6a5b26f2cf2d1fd1)
This commit is contained in:
11
magnets.c
11
magnets.c
@ -230,8 +230,15 @@ static game_params *custom_params(const config_item *cfg)
|
||||
|
||||
static const char *validate_params(const game_params *params, bool full)
|
||||
{
|
||||
if (params->w < 2) return "Width must be at least one";
|
||||
if (params->h < 2) return "Height must be at least one";
|
||||
if (params->w < 2) return "Width must be at least two";
|
||||
if (params->h < 2) return "Height must be at least two";
|
||||
if (params->diff >= DIFF_TRICKY) {
|
||||
if (params->w < 5 && params->h < 5)
|
||||
return "Either width or height must be at least five for Tricky";
|
||||
} else {
|
||||
if (params->w < 3 && params->h < 3)
|
||||
return "Either width or height must be at least three";
|
||||
}
|
||||
if (params->diff < 0 || params->diff >= DIFFCOUNT)
|
||||
return "Unknown difficulty level";
|
||||
|
||||
|
Reference in New Issue
Block a user