mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Remove arbitrary restriction on Net minimum game size. (Awww, cute
2x2! Cuter 2x1!) [originally from svn r4181]
This commit is contained in:
8
net.c
8
net.c
@ -215,8 +215,8 @@ game_state *new_game(game_params *params, char *seed)
|
|||||||
tree234 *possibilities, *barriers;
|
tree234 *possibilities, *barriers;
|
||||||
int w, h, x, y, nbarriers;
|
int w, h, x, y, nbarriers;
|
||||||
|
|
||||||
assert(params->width > 2);
|
assert(params->width > 0 && params->height > 0);
|
||||||
assert(params->height > 2);
|
assert(params->width > 1 || params->height > 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a blank game state.
|
* Create a blank game state.
|
||||||
@ -297,9 +297,13 @@ game_state *new_game(game_params *params, char *seed)
|
|||||||
*/
|
*/
|
||||||
possibilities = newtree234(xyd_cmp);
|
possibilities = newtree234(xyd_cmp);
|
||||||
|
|
||||||
|
if (state->cx+1 < state->width)
|
||||||
add234(possibilities, new_xyd(state->cx, state->cy, R));
|
add234(possibilities, new_xyd(state->cx, state->cy, R));
|
||||||
|
if (state->cy-1 >= 0)
|
||||||
add234(possibilities, new_xyd(state->cx, state->cy, U));
|
add234(possibilities, new_xyd(state->cx, state->cy, U));
|
||||||
|
if (state->cx-1 >= 0)
|
||||||
add234(possibilities, new_xyd(state->cx, state->cy, L));
|
add234(possibilities, new_xyd(state->cx, state->cy, L));
|
||||||
|
if (state->cy+1 < state->height)
|
||||||
add234(possibilities, new_xyd(state->cx, state->cy, D));
|
add234(possibilities, new_xyd(state->cx, state->cy, D));
|
||||||
|
|
||||||
while (count234(possibilities) > 0) {
|
while (count234(possibilities) > 0) {
|
||||||
|
Reference in New Issue
Block a user