mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Constrain mine count to be at most the largest number of mines we
can guarantee to fit into the grid! [originally from svn r5867]
This commit is contained in:
2
mines.c
2
mines.c
@ -255,6 +255,8 @@ static char *validate_params(game_params *params)
|
|||||||
return "Width must be greater than zero";
|
return "Width must be greater than zero";
|
||||||
if (params->h <= 0)
|
if (params->h <= 0)
|
||||||
return "Height must be greater than zero";
|
return "Height must be greater than zero";
|
||||||
|
if (params->n > params->w * params->h - 9)
|
||||||
|
return "Too many mines for grid size";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME: Need more constraints here. Not sure what the
|
* FIXME: Need more constraints here. Not sure what the
|
||||||
|
Reference in New Issue
Block a user