x = i%w;
y = i/w;
if (abs(ox-x) > 1 || abs(oy-y) > 1) {
- if (!state->sflags[i] & S_TRACK)
+ if (!(state->sflags[i] & S_TRACK))
did += solve_set_sflag(state, x, y, S_NOTRACK, what);
}
}
for (i = 0; i < w*h; i++) {
state->sflags[i] &= ~S_ERROR;
if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0) {
- if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 2)
+ if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 2) {
+ ret = FALSE;
state->sflags[i] |= S_ERROR;
+ }
}
}
}
debug(("col %d error: target %d, track %d, notrack %d",
x, target, ntrack, nnotrack));
state->num_errors[x] = 1;
+ ret = FALSE;
}
}
if (ntrackcomplete != target)
debug(("row %d error: target %d, track %d, notrack %d",
y, target, ntrack, nnotrack));
state->num_errors[w+y] = 1;
+ ret = FALSE;
}
}
if (ntrackcomplete != target)
for (i = 0; i < w*h; i++) {
if ((dsf_canonify(dsf, i) != pathclass) &&
((state->sflags[i] & S_TRACK) ||
- (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0)))
+ (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0))) {
+ ret = FALSE;
state->sflags[i] |= S_ERROR;
+ }
}
+ } else {
+ /* If we _don't_ have such a path, then certainly the game
+ * can't be in a winning state. So even if we're not
+ * highlighting any _errors_, we certainly shouldn't
+ * return true. */
+ ret = FALSE;
}
}
const struct game thegame = {
"Train Tracks", "games.tracks", "tracks",
default_params,
- game_fetch_preset,
+ game_fetch_preset, NULL,
decode_params,
encode_params,
free_params,