chiark / gitweb /
Highlight clue errors in Tracks in some more situations.
authorJonas Kölker <jonaskoelker@yahoo.com>
Tue, 13 Oct 2015 13:47:42 +0000 (15:47 +0200)
committerSimon Tatham <anakin@pobox.com>
Wed, 21 Oct 2015 21:03:02 +0000 (22:03 +0100)
 - Count any square as having a track either if the square is marked
   as such (rendered as a different background), or if at least one
   adjacent edge is marked as containing a segment of train track
   (rendered as train tracks if they're placed, else as an '=').

 - Do the same counting in rows and columns.

tracks.c

index 0944ca1b3596ee5ae73045ab459b05253c951aa6..c6b3d8e148c70787dc917481712ff47cb23a16ef 100644 (file)
--- a/tracks.c
+++ b/tracks.c
@@ -1538,7 +1538,8 @@ static int check_completion(game_state *state, int mark)
         target = state->numbers->numbers[x];
         ntrack = nnotrack = 0;
         for (y = 0; y < h; y++) {
-            if (S_E_COUNT(state, x, y, E_TRACK) > 0)
+            if (S_E_COUNT(state, x, y, E_TRACK) > 0 ||
+                state->sflags[y*w+x] & S_TRACK)
                 ntrack++;
             if (state->sflags[y*w+x] & S_NOTRACK)
                 nnotrack++;
@@ -1557,7 +1558,8 @@ static int check_completion(game_state *state, int mark)
         target = state->numbers->numbers[w+y];
         ntrack = nnotrack = 0;
         for (x = 0; x < w; x++) {
-            if (S_E_COUNT(state, x, y, E_TRACK) == 2)
+            if (S_E_COUNT(state, x, y, E_TRACK) > 0 ||
+                state->sflags[y*w+x] & S_TRACK)
                 ntrack++;
             if (state->sflags[y*w+x] & S_NOTRACK)
                 nnotrack++;