~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The Light Up solver limits its recursion depth, so if it fails to find
[sgt/puzzles]
/
lightup.c
diff --git
a/lightup.c
b/lightup.c
index
5fe95b0
..
47b49b2
100644
(file)
--- a/
lightup.c
+++ b/
lightup.c
@@
-215,6
+215,11
@@
static void decode_params(game_params *params, char const *string)
if (*string == 's') {
string++;
EATNUM(params->symm);
if (*string == 's') {
string++;
EATNUM(params->symm);
+ } else {
+ /* cope with user input such as '18x10' by ensuring symmetry
+ * is not selected by default to be incompatible with dimensions */
+ if (params->symm == SYMM_ROT4 && params->w != params->h)
+ params->symm = SYMM_ROT2;
}
params->difficulty = 0;
/* cope with old params */
}
params->difficulty = 0;
/* cope with old params */
@@
-1672,7
+1677,7
@@
static char *solve_game(game_state *state, game_state *currstate,
/* That didn't work; try solving from the clean puzzle. */
solved = dup_game(state);
if (dosolve(solved, sflags, NULL) > 0) goto solved;
/* That didn't work; try solving from the clean puzzle. */
solved = dup_game(state);
if (dosolve(solved, sflags, NULL) > 0) goto solved;
- *error = "
Puzzle is not self-consistent
.";
+ *error = "
Unable to find a solution to this puzzle
.";
goto done;
solved:
goto done;
solved: