X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/f04d88ba2c57c09a2e2598558ff1a42a7d86cfde..40785ed96c9dbe9a5a630b69faa0bbc9a8435091:/unequal.c diff --git a/unequal.c b/unequal.c index f21f579..1c272da 100644 --- 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 } } @@ -1626,21 +1627,25 @@ static void draw_gts(drawing *dr, game_drawstate *ds, int ox, int oy, /* Draw all the greater-than signs emanating from this tile. */ if (f & F_ADJ_UP) { + draw_rect(dr, ox, oy - g, TILE_SIZE, g, COL_BACKGROUND); draw_gt(dr, ox+g2, oy-g4, g2, -g2, g2, g2, (f & F_ERROR_UP) ? COL_ERROR : col); draw_update(dr, ox, oy-g, TILE_SIZE, g); } if (f & F_ADJ_RIGHT) { + draw_rect(dr, ox + TILE_SIZE, oy, g, TILE_SIZE, COL_BACKGROUND); draw_gt(dr, ox+TILE_SIZE+g4, oy+g2, g2, g2, -g2, g2, (f & F_ERROR_RIGHT) ? COL_ERROR : col); draw_update(dr, ox+TILE_SIZE, oy, g, TILE_SIZE); } if (f & F_ADJ_DOWN) { + draw_rect(dr, ox, oy + TILE_SIZE, TILE_SIZE, g, COL_BACKGROUND); draw_gt(dr, ox+g2, oy+TILE_SIZE+g4, g2, g2, g2, -g2, (f & F_ERROR_DOWN) ? COL_ERROR : col); draw_update(dr, ox, oy+TILE_SIZE, TILE_SIZE, g); } if (f & F_ADJ_LEFT) { + draw_rect(dr, ox - g, oy, g, TILE_SIZE, COL_BACKGROUND); draw_gt(dr, ox-g4, oy+g2, -g2, g2, g2, g2, (f & F_ERROR_LEFT) ? COL_ERROR : col); draw_update(dr, ox-g, oy, g, TILE_SIZE); @@ -1860,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; @@ -1948,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,