char *err, *soln, *p;
/*
+ * Before anything else, deal with the special case in which
+ * all the gems are already collected.
+ */
+ for (i = 0; i < wh; i++)
+ if (currstate->grid[i] == GEM)
+ break;
+ if (i == wh) {
+ *error = "Game is already solved";
+ return NULL;
+ }
+
+ /*
* Solving Inertia is a question of first building up the graph
* of where you can get to from where, and secondly finding a
* tour of the graph which takes in every gem.
}
}
-#ifndef TSP_DIAGNOSTICS
+#ifdef TSP_DIAGNOSTICS
printf("before reduction, moves are ");
x = nodes[circuit[0]] / DP1 % w;
y = nodes[circuit[0]] / DP1 / w;
p = min(i, j);
q = max(i, j);
-#ifndef TSP_DIAGNOSTICS
+#ifdef TSP_DIAGNOSTICS
printf("optimising section from %d - %d\n", p, q);
#endif
if (dir > 0)
i = q; /* resume loop from the right place */
-#ifndef TSP_DIAGNOSTICS
+#ifdef TSP_DIAGNOSTICS
printf("new section runs from %d - %d\n", p, q);
#endif
j = i;
-#ifndef TSP_DIAGNOSTICS
+#ifdef TSP_DIAGNOSTICS
printf("during reduction, circuit is");
for (k = 0; k < circuitlen; k++) {
int nc = nodes[circuit[k]];
}
}
-#ifndef TSP_DIAGNOSTICS
+#ifdef TSP_DIAGNOSTICS
printf("after reduction, moves are ");
x = nodes[circuit[0]] / DP1 % w;
y = nodes[circuit[0]] / DP1 / w;
ds->player_background = blitter_new(dr, 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);
int i;
return 0.0F;
}
-static int game_wants_statusbar(void)
-{
- return TRUE;
-}
-
static int game_timing_state(game_state *state, game_ui *ui)
{
return TRUE;
game_anim_length,
game_flash_length,
FALSE, FALSE, game_print_size, game_print,
- game_wants_statusbar,
+ TRUE, /* wants_statusbar */
FALSE, game_timing_state,
- 0, /* mouse_priorities */
+ 0, /* flags */
};