X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/40f89e91b4f5fc2cbc01486e7387a8ae530356df..ffb5d90c357b7d13ba1f2ca13e7ef29b934a845f:/unfinished/pearl.c diff --git a/unfinished/pearl.c b/unfinished/pearl.c index 41ab998..bd40dba 100644 --- 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) { + int done_something = FALSE; #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 - int done_something = FALSE; - /* * 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); +#endif 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); +#endif ret = 0; goto cleanup; -#endif } 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: /*