mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
cube.c: Prohibit unsolvable single row/column game
For cube games, the minimum for any dimension should be 2, as there is no net of the cube that is only one row/column. The previous logic would permit a 1x7 game (for example) that could never be solved.
This commit is contained in:

committed by
Simon Tatham

parent
1db5961b8b
commit
55be8e50db
4
cube.c
4
cube.c
@ -543,8 +543,8 @@ static const char *validate_params(const game_params *params, int full)
|
|||||||
return "Unrecognised solid type";
|
return "Unrecognised solid type";
|
||||||
|
|
||||||
if (solids[params->solid]->order == 4) {
|
if (solids[params->solid]->order == 4) {
|
||||||
if (params->d1 <= 0 || params->d2 <= 0)
|
if (params->d1 <= 1 || params->d2 <= 1)
|
||||||
return "Both grid dimensions must be greater than zero";
|
return "Both grid dimensions must be greater than one";
|
||||||
} else {
|
} else {
|
||||||
if (params->d1 <= 0 && params->d2 <= 0)
|
if (params->d1 <= 0 && params->d2 <= 0)
|
||||||
return "At least one grid dimension must be greater than zero";
|
return "At least one grid dimension must be greater than zero";
|
||||||
|
Reference in New Issue
Block a user