X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/9003c6f7c564e586cd118034069ec3cd1546cc15..HEAD:/solo.c diff --git a/solo.c b/solo.c index 766adde..d9bf18d 100644 --- a/solo.c +++ b/solo.c @@ -1473,7 +1473,7 @@ static int solver_killer_sums(struct solver_usage *usage, int b, } assert(nsquares > 0); - if (nsquares > 4) + if (nsquares < 2 || nsquares > 4) return 0; if (!cage_is_region) { @@ -1773,9 +1773,16 @@ static void solver(int cr, struct block_structure *blocks, * Place all the clue numbers we are given. */ for (x = 0; x < cr; x++) - for (y = 0; y < cr; y++) - if (grid[y*cr+x]) + for (y = 0; y < cr; y++) { + int n = grid[y*cr+x]; + if (n) { + if (!cube(x,y,n)) { + diff = DIFF_IMPOSSIBLE; + goto got_result; + } solver_place(usage, x, y, grid[y*cr+x]); + } + } /* * Now loop over the grid repeatedly trying all permitted modes @@ -2041,7 +2048,7 @@ static void solver(int cr, struct block_structure *blocks, ); if (ret > 0) { changed = TRUE; - kdiff = max(kdiff, DIFF_KINTERSECT); + kdiff = max(kdiff, DIFF_KSUMS); } else if (ret < 0) { diff = DIFF_IMPOSSIBLE; goto got_result; @@ -4504,7 +4511,7 @@ struct game_drawstate { int nregions, *entered_items; }; -static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds, +static char *interpret_move(game_state *state, game_ui *ui, const game_drawstate *ds, int x, int y, int button) { int cr = state->cr;