mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Don't fail an assertion when setting up the provided clues at the
start of the solver, if they contradict each other. (Could trigger on user-provided grids.) [originally from svn r9594]
This commit is contained in:
11
solo.c
11
solo.c
@ -1773,9 +1773,16 @@ static void solver(int cr, struct block_structure *blocks,
|
|||||||
* Place all the clue numbers we are given.
|
* Place all the clue numbers we are given.
|
||||||
*/
|
*/
|
||||||
for (x = 0; x < cr; x++)
|
for (x = 0; x < cr; x++)
|
||||||
for (y = 0; y < cr; y++)
|
for (y = 0; y < cr; y++) {
|
||||||
if (grid[y*cr+x])
|
int n = grid[y*cr+x];
|
||||||
|
if (n) {
|
||||||
|
if (!cube(x,y,n)) {
|
||||||
|
diff = DIFF_IMPOSSIBLE;
|
||||||
|
goto got_result;
|
||||||
|
}
|
||||||
solver_place(usage, x, y, grid[y*cr+x]);
|
solver_place(usage, x, y, grid[y*cr+x]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now loop over the grid repeatedly trying all permitted modes
|
* Now loop over the grid repeatedly trying all permitted modes
|
||||||
|
Reference in New Issue
Block a user