chiark / gitweb /
Unequal: run check_complete() after a hint move.
authorSimon Tatham <anakin@pobox.com>
Thu, 19 Oct 2017 23:33:54 +0000 (00:33 +0100)
committerSimon Tatham <anakin@pobox.com>
Thu, 19 Oct 2017 23:33:54 +0000 (00:33 +0100)
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

index 12d84bf80a41f79058651915b649cd84fb0a8cda..cb477c9e37af3fd8ffbcc4d67e6f72a6912c95e0 100644 (file)
--- 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);