diff options
| author | Simon Tatham <anakin@pobox.com> | 2012-07-29 21:29:26 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2012-07-29 21:29:26 +0000 |
| commit | bbf800e49ee5965c21eb4a89116e7529d0d4954f (patch) | |
| tree | f88b758585768eed06a17c322db615d0b2f2de32 | |
| parent | 6567260eb0af75a3c82f4a8a8292c6446d94fd98 (diff) | |
| download | puzzles-bbf800e49ee5965c21eb4a89116e7529d0d4954f.zip puzzles-bbf800e49ee5965c21eb4a89116e7529d0d4954f.tar.gz puzzles-bbf800e49ee5965c21eb4a89116e7529d0d4954f.tar.bz2 puzzles-bbf800e49ee5965c21eb4a89116e7529d0d4954f.tar.xz | |
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]
| -rw-r--r-- | solo.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1773,9 +1773,16 @@ static void solver(int cr, struct block_structure *blocks, * Place all the clue numbers we are given. */ for (x = 0; x < cr; x++) - for (y = 0; y < cr; y++) - if (grid[y*cr+x]) + for (y = 0; y < cr; y++) { + 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]); + } + } /* * Now loop over the grid repeatedly trying all permitted modes |