grid2[coords[2*j+1]*cr+coords[2*j]] = 0;
ret = solver(c, r, grid2, maxdiff);
- if (ret != DIFF_IMPOSSIBLE && ret != DIFF_AMBIGUOUS) {
+ if (ret <= maxdiff) {
for (j = 0; j < ncoords; j++)
grid[coords[2*j+1]*cr+coords[2*j]] = 0;
}
} else if (n == '_') {
/* do nothing */;
} else if (n > '0' && n <= '9') {
+ int val = atoi(desc-1);
+ if (val < 1 || val > params->c * params->r)
+ return "Out-of-range number in game description";
squares++;
while (*desc >= '0' && *desc <= '9')
desc++;
for (x = 0; x < cr; x++) {
int ch = grid[y * cr + x];
if (ch == 0)
- ch = ' ';
+ ch = '.';
else if (ch <= 9)
ch = '0' + ch;
else
ds->tilesize = tilesize;
}
-static float *game_colours(frontend *fe, game_state *state, int *ncolours)
+static float *game_colours(frontend *fe, int *ncolours)
{
float *ret = snewn(3 * NCOLOURS, float);
return 0.0F;
}
-static int game_wants_statusbar(void)
-{
- return FALSE;
-}
-
static int game_timing_state(game_state *state, game_ui *ui)
{
return TRUE;
/* Ick: fake up `ds->tilesize' for macro expansion purposes */
game_drawstate ads, *ds = &ads;
- ads.tilesize = tilesize;
+ game_set_size(dr, ds, NULL, tilesize);
/*
* Border.
game_anim_length,
game_flash_length,
TRUE, FALSE, game_print_size, game_print,
- game_wants_statusbar,
+ FALSE, /* wants_statusbar */
FALSE, game_timing_state,
- 0, /* mouse_priorities */
+ 0, /* flags */
};
#ifdef STANDALONE_SOLVER