chiark / gitweb /
Improve Towers error highlighting.
authorJonas Kölker <jonaskoelker@yahoo.com>
Thu, 1 Oct 2015 16:47:55 +0000 (18:47 +0200)
committerSimon Tatham <anakin@pobox.com>
Sat, 3 Oct 2015 17:17:25 +0000 (18:17 +0100)
Highlight clues of value n in Towers if its row/column contains an
increasing sequence of length n, the last number of which is not equal
to the number of rows/columns (i.e. such that the sequence will have
to be extended, in violation of the clue).

towers.c

index 7666af9e00cb499312092262838ab5ab49f6ee49..9525adb56b19aec96fb011c78ffd80c24cd6f5ee 100644 (file)
--- a/towers.c
+++ b/towers.c
@@ -1248,7 +1248,8 @@ static int check_errors(const game_state *state, int *errors)
            }
        }
 
-       if (n > clues[i] || (j == w && n < clues[i])) {
+       if (n > clues[i] || (best == w && n < clues[i]) ||
+           (best < w && n == clues[i])) {
            if (errors) {
                int x, y;
                CLUEPOS(x, y, i, w);