aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-02-08 18:22:23 +0000
committerSimon Tatham <anakin@pobox.com>2023-02-08 18:22:23 +0000
commitbd5c0a37a019c540eda05f8291cad90ffd598134 (patch)
tree85d7bbc03f7c3caba236836af20ceaaf5abdc44b
parent49841bd0fc04490d94cf32c0e6f9d3f4ffabe098 (diff)
downloadpuzzles-bd5c0a37a019c540eda05f8291cad90ffd598134.zip
puzzles-bd5c0a37a019c540eda05f8291cad90ffd598134.tar.gz
puzzles-bd5c0a37a019c540eda05f8291cad90ffd598134.tar.bz2
puzzles-bd5c0a37a019c540eda05f8291cad90ffd598134.tar.xz
Unequal: fix sense error in latin_solver_alloc fix.
In commit 5030d87903191d5 I gave latin_solver_alloc a return value, and introduced a check of that value at every call site. One of the checks was backwards, with the effect that Unequal game generation now more or less always fails an assertion. For example: $ unequal --generate 1 4#12345 unequal: unequal.c:1072: gg_best_clue: Assertion `best != -1' failed.
-rw-r--r--unequal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unequal.c b/unequal.c
index 0a2bafd..52041bb 100644
--- a/unequal.c
+++ b/unequal.c
@@ -890,7 +890,7 @@ static int solver_state(game_state *state, int maxdiff)
struct latin_solver solver;
int diff;
- if (!latin_solver_alloc(&solver, state->nums, state->order))
+ if (latin_solver_alloc(&solver, state->nums, state->order))
diff = latin_solver_main(&solver, maxdiff,
DIFF_LATIN, DIFF_SET, DIFF_EXTREME,
DIFF_EXTREME, DIFF_RECURSIVE,