aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-10-20 00:33:54 +0100
committerSimon Tatham <anakin@pobox.com>2017-10-20 00:33:54 +0100
commit38ea1599fe0bf995f5c16b3d2995643976387e15 (patch)
treed6aee91dba3e61c70e8cafdf286b119f7eea8963
parent00e23909f8599686ae8aa975a7f5a443a500516f (diff)
downloadpuzzles-38ea1599fe0bf995f5c16b3d2995643976387e15.zip
puzzles-38ea1599fe0bf995f5c16b3d2995643976387e15.tar.gz
puzzles-38ea1599fe0bf995f5c16b3d2995643976387e15.tar.bz2
puzzles-38ea1599fe0bf995f5c16b3d2995643976387e15.tar.xz
Unequal: run check_complete() after a hint move.
A user sent in the game id 7:0,0L,0,0,0L,0L,1,0U,0U,0D,0UD,0,0,7,0,0D,0,0D,0,0,0,0,0,0,0,0,0,0D,0,0,3,0,0U,0,0,0,0,2,6,0,0U,0,0,0,7,2,0,0U,5L, starting from which, one press of 'h' will fill in a 2 in the top left corner and possibilities 345 to its right; if you then fill in 5 there and press 'h' again, the hint system fills in the whole of an apparent solution which isn't the one a proper use of the Solve feature would give you - except that it's not actually a second solution, because one < clue on the top row is violated. Without this fix, that < failed to light up red, making the puzzle look ambiguous if you're not paying enough attention to spot it.
-rw-r--r--unequal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/unequal.c b/unequal.c
index 12d84bf..cb477c9 100644
--- a/unequal.c
+++ b/unequal.c
@@ -1566,7 +1566,9 @@ static game_state *execute_move(const game_state *state, const char *move)
}
return ret;
} else if (move[0] == 'H') {
- return solver_hint(state, NULL, DIFF_EASY, DIFF_EASY);
+ ret = solver_hint(state, NULL, DIFF_EASY, DIFF_EASY);
+ check_complete(ret->nums, ret, 1);
+ return ret;
} else if (move[0] == 'F' && sscanf(move+1, "%d,%d,%d", &x, &y, &n) == 3 &&
x >= 0 && x < state->order && y >= 0 && y < state->order) {
ret = dup_game(state);