From 38ea1599fe0bf995f5c16b3d2995643976387e15 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 20 Oct 2017 00:33:54 +0100 Subject: [PATCH] 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. --- unequal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);