~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add functions provided by the midend to tell a front end whether GUI
[sgt/puzzles]
/
unfinished
/
pearl.c
diff --git
a/unfinished/pearl.c
b/unfinished/pearl.c
index
0ef6247
..
bd40dba
100644
(file)
--- a/
unfinished/pearl.c
+++ b/
unfinished/pearl.c
@@
-217,6
+217,7
@@
int pearl_solve(int w, int h, char *clues, char *result)
* Now repeatedly try to find something we can do.
*/
while (1) {
* Now repeatedly try to find something we can do.
*/
while (1) {
+ int done_something = FALSE;
#ifdef SOLVER_DIAGNOSTICS
for (y = 0; y < H; y++) {
#ifdef SOLVER_DIAGNOSTICS
for (y = 0; y < H; y++) {
@@
-226,8
+227,6
@@
int pearl_solve(int w, int h, char *clues, char *result)
}
#endif
}
#endif
- int done_something = FALSE;
-
/*
* Go through the square state words, and discard any
* square state which is inconsistent with known facts
/*
* Go through the square state words, and discard any
* square state which is inconsistent with known facts
@@
-267,9
+266,9
@@
int pearl_solve(int w, int h, char *clues, char *result)
if (!workspace[(2*y+1)*W+(2*x+1)]) {
#ifdef SOLVER_DIAGNOSTICS
printf("edge check at (%d,%d): inconsistency\n", x, y);
if (!workspace[(2*y+1)*W+(2*x+1)]) {
#ifdef SOLVER_DIAGNOSTICS
printf("edge check at (%d,%d): inconsistency\n", x, y);
+#endif
ret = 0;
goto cleanup;
ret = 0;
goto cleanup;
-#endif
}
}
}
}
@@
-298,9
+297,9
@@
int pearl_solve(int w, int h, char *clues, char *result)
if (edgeand & ~edgeor) {
#ifdef SOLVER_DIAGNOSTICS
printf("square check at (%d,%d): inconsistency\n", x, y);
if (edgeand & ~edgeor) {
#ifdef SOLVER_DIAGNOSTICS
printf("square check at (%d,%d): inconsistency\n", x, y);
+#endif
ret = 0;
goto cleanup;
ret = 0;
goto cleanup;
-#endif
}
for (d = 1; d <= 8; d += d) {
}
for (d = 1; d <= 8; d += d) {
@@
-385,7
+384,6
@@
int pearl_solve(int w, int h, char *clues, char *result)
}
}
}
}
-
break;
case STRAIGHT:
/*
break;
case STRAIGHT:
/*
@@
-1236,6
+1234,11
@@
static char *solve_game(game_state *state, game_state *currstate,
return NULL;
}
return NULL;
}
+static int game_can_format_as_text_now(game_params *params)
+{
+ return TRUE;
+}
+
static char *game_text_format(game_state *state)
{
return NULL;
static char *game_text_format(game_state *state)
{
return NULL;
@@
-1364,7
+1367,7
@@
static void game_print(drawing *dr, game_state *state, int tilesize)
#endif
const struct game thegame = {
#endif
const struct game thegame = {
- "Pearl", NULL,
+ "Pearl", NULL,
NULL,
default_params,
game_fetch_preset,
decode_params,
default_params,
game_fetch_preset,
decode_params,
@@
-1379,7
+1382,7
@@
const struct game thegame = {
dup_game,
free_game,
FALSE, solve_game,
dup_game,
free_game,
FALSE, solve_game,
- FALSE, game_text_format,
+ FALSE, game_
can_format_as_text_now, game_
text_format,
new_ui,
free_ui,
encode_ui,
new_ui,
free_ui,
encode_ui,