mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
Prevent starting in a solved state in Fifteen & Flood
(cherry picked from Android port, commit cb38abdc71780bd9b393b90514396c338306fa69)
This commit is contained in:
6
flood.c
6
flood.c
@ -552,8 +552,10 @@ static char *new_game_desc(const game_params *params, random_state *rs,
|
||||
/*
|
||||
* Invent a random grid.
|
||||
*/
|
||||
for (i = 0; i < wh; i++)
|
||||
scratch->grid[i] = random_upto(rs, params->colours);
|
||||
do {
|
||||
for (i = 0; i < wh; i++)
|
||||
scratch->grid[i] = random_upto(rs, params->colours);
|
||||
} while (completed(w, h, scratch->grid));
|
||||
|
||||
/*
|
||||
* Run the solver, and count how many moves it uses.
|
||||
|
Reference in New Issue
Block a user