diff options
| author | Jonas Kölker <jonaskoelker@yahoo.com> | 2015-10-13 15:47:42 +0200 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2015-10-21 22:03:02 +0100 |
| commit | 44e2690abb523aa60558ca6326eaeb9ce6287454 (patch) | |
| tree | 749618effbc7cc00979c35b2dbb853054bd100fa | |
| parent | 80b63e6cefb0e1055bdd5f2f8238d7cc8c23f51f (diff) | |
| download | puzzles-44e2690abb523aa60558ca6326eaeb9ce6287454.zip puzzles-44e2690abb523aa60558ca6326eaeb9ce6287454.tar.gz puzzles-44e2690abb523aa60558ca6326eaeb9ce6287454.tar.bz2 puzzles-44e2690abb523aa60558ca6326eaeb9ce6287454.tar.xz | |
Highlight clue errors in Tracks in some more situations.
- 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.
| -rw-r--r-- | tracks.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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++; |