Apply a missing bit of r9164, which only broke the build with
[sgt/puzzles] / unequal.c
index 57fbea3..1c272da 100644 (file)
--- a/unequal.c
+++ b/unequal.c
@@ -951,7 +951,7 @@ static int gg_best_clue(game_state *state, int *scratch, digit *latin)
 {
     int ls = state->order * state->order * 5;
     int maxposs = 0, minclues = 5, best = -1, i, j;
-    int nposs, nclues, loc, x, y;
+    int nposs, nclues, loc;
 
 #ifdef STANDALONE_SOLVER
     if (solver_show_working) {
@@ -964,7 +964,6 @@ static int gg_best_clue(game_state *state, int *scratch, digit *latin)
         if (!gg_place_clue(state, scratch[i], latin, 1)) continue;
 
         loc = scratch[i] / 5;
-        x = loc % state->order; y = loc / state->order;
         for (j = nposs = 0; j < state->order; j++) {
             if (state->hints[loc*state->order + j]) nposs++;
         }
@@ -975,9 +974,11 @@ static int gg_best_clue(game_state *state, int *scratch, digit *latin)
             (nposs == maxposs && nclues < minclues)) {
             best = i; maxposs = nposs; minclues = nclues;
 #ifdef STANDALONE_SOLVER
-            if (solver_show_working)
+            if (solver_show_working) {
+                int x = loc % state->order, y = loc / state->order;
                 printf("gg_best_clue: b%d (%d,%d) new best [%d poss, %d clues].\n",
                        best, x+1, y+1, nposs, nclues);
+            }
 #endif
         }
     }
@@ -1864,6 +1865,11 @@ static float game_flash_length(game_state *oldstate, game_state *newstate,
     return 0.0F;
 }
 
+static int game_is_solved(game_state *state)
+{
+    return state->completed;
+}
+
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1952,6 +1958,7 @@ const struct game thegame = {
     game_redraw,
     game_anim_length,
     game_flash_length,
+    game_is_solved,
     TRUE, FALSE, game_print_size, game_print,
     FALSE,                            /* wants_statusbar */
     FALSE, game_timing_state,