aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-09-12 17:09:29 +0000
committerSimon Tatham <anakin@pobox.com>2005-09-12 17:09:29 +0000
commita8980f3736031dc971754bd7ecc55795680a62e5 (patch)
treea57c75abcca62ae2ecf5b59e425410a670180b2c
parentf07576f49e9b08c9a9b2482b07e14a3e846224eb (diff)
downloadpuzzles-a8980f3736031dc971754bd7ecc55795680a62e5.zip
puzzles-a8980f3736031dc971754bd7ecc55795680a62e5.tar.gz
puzzles-a8980f3736031dc971754bd7ecc55795680a62e5.tar.bz2
puzzles-a8980f3736031dc971754bd7ecc55795680a62e5.tar.xz
I am again gormless! When I overhauled Solo's grid generator in
r6160, I completely failed to ensure that generated grids were _at most_ the required difficulty. It appears to have been only random chance that prevented a request for a Trivial puzzle from producing Extreme. Here's a one-line fix. [originally from svn r6298] [r6160 == e55838bc9b0d173ca539d0cfe714495b5c12b9dd]
-rw-r--r--solo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/solo.c b/solo.c
index efd795b..05774a4 100644
--- a/solo.c
+++ b/solo.c
@@ -2220,7 +2220,7 @@ static char *new_game_desc(game_params *params, random_state *rs,
grid2[coords[2*j+1]*cr+coords[2*j]] = 0;
ret = solver(c, r, grid2, maxdiff);
- if (ret != DIFF_IMPOSSIBLE && ret != DIFF_AMBIGUOUS) {
+ if (ret <= maxdiff) {
for (j = 0; j < ncoords; j++)
grid[coords[2*j+1]*cr+coords[2*j]] = 0;
}