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:
Simon Tatham
2005-05-30 17:57:45 +00:00
parent 90560462c4
commit 0e5380b96d

View File

@ -255,6 +255,8 @@ static char *validate_params(game_params *params)
return "Width must be greater than zero";
if (params->h <= 0)
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