X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/750037d76de7c1ab5d46aaf8a712f32599e7d563..ff5d35e1a92e919353b016417132ca3497b65b16:/unfinished/pearl.c?ds=sidebyside diff --git a/unfinished/pearl.c b/unfinished/pearl.c index af25415..51b2ed2 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: /* @@ -1236,6 +1234,11 @@ static char *solve_game(game_state *state, game_state *currstate, 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; @@ -1346,6 +1349,11 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } +static int game_status(game_state *state) +{ + return 0; +} + static int game_timing_state(game_state *state, game_ui *ui) { return TRUE; @@ -1379,7 +1387,7 @@ const struct game thegame = { 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, @@ -1394,6 +1402,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, + game_status, FALSE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state,