From: simon Date: Tue, 7 Feb 2006 21:45:50 +0000 (+0000) Subject: Tal Kelrich spotted that hitting `Solve' on a configuration which is X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/commitdiff_plain/f7d4bf1aa9f1b175c65068cdee223ed129eb4103 Tal Kelrich spotted that hitting `Solve' on a configuration which is laser-indistinguishable from the right solution _but_ has a number of balls outside the acceptable range does not report an error. His example was the game ID w8h8m5M5:1e3e6e80fa3e16265ccef7ca , omitting the rightmost ball in the second row. git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6542 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/blackbox.c b/blackbox.c index 835175d..165ee2e 100644 --- a/blackbox.c +++ b/blackbox.c @@ -813,7 +813,9 @@ static int check_guesses(game_state *state, int cagey) ret = 0; } } - if (ret == 0) goto done; + if (ret == 0 || + state->nguesses < state->minballs || + state->nguesses > state->maxballs) goto done; /* fix up original state so the 'correct' balls end up matching the guesses, * as we've just proved that they were equivalent. */