diff options
| author | Simon Tatham <anakin@pobox.com> | 2010-03-21 14:30:49 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2010-03-21 14:30:49 +0000 |
| commit | 50b6e0d7087b6b9b4bc64f279e0ae424f1a24f6b (patch) | |
| tree | 5bfb11248d647b1ce22cb56b3126e17cd494e0a5 /unequal.c | |
| parent | 5627dc4049915e3b05f74ac87e36503f6f3fc62d (diff) | |
| download | puzzles-50b6e0d7087b6b9b4bc64f279e0ae424f1a24f6b.zip puzzles-50b6e0d7087b6b9b4bc64f279e0ae424f1a24f6b.tar.gz puzzles-50b6e0d7087b6b9b4bc64f279e0ae424f1a24f6b.tar.bz2 puzzles-50b6e0d7087b6b9b4bc64f279e0ae424f1a24f6b.tar.xz | |
Chris Boyle reports an off-by-two error ('a Qui-Gon Jinx' :-) in
difficulty selection in Unequal's solver. I suspect I missed this
when I refactored latin.c and its callers.
[originally from svn r8906]
Diffstat (limited to 'unequal.c')
| -rw-r--r-- | unequal.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -98,10 +98,9 @@ struct game_state { #define TITLE(upper,title,func,lower) #title, #define ENCODE(upper,title,func,lower) #lower #define CONFIG(upper,title,func,lower) ":" #title -enum { DIFFLIST(ENUM) DIFF_IMPOSSIBLE = diff_impossible, DIFF_AMBIGUOUS = diff_ambiguous, DIFF_UNFINISHED = diff_unfinished }; +enum { DIFFLIST(ENUM) DIFFCOUNT, DIFF_IMPOSSIBLE = diff_impossible, DIFF_AMBIGUOUS = diff_ambiguous, DIFF_UNFINISHED = diff_unfinished }; static char const *const unequal_diffnames[] = { DIFFLIST(TITLE) }; static char const unequal_diffchars[] = DIFFLIST(ENCODE); -#define DIFFCOUNT lenof(unequal_diffchars) #define DIFFCONFIG DIFFLIST(CONFIG) #define DEFAULT_PRESET 0 @@ -1310,7 +1309,7 @@ static char *solve_game(game_state *state, game_state *currstate, if (!(solved->flags[r] & F_IMMUTABLE)) solved->nums[r] = 0; } - r = solver_state(solved, DIFFCOUNT); + r = solver_state(solved, DIFFCOUNT-1); /* always use full solver */ if (r > 0) ret = latin_desc(solved->nums, solved->order); free_game(solved); return ret; |