static int map_hasloops(game_state *state, int mark)
{
- int x, y, ox, oy, nx, ny, loop = 0;
+ int x, y, ox, oy, nx = 0, ny = 0, loop = 0;
memcpy(state->scratch, state->grid, GRIDSZ(state));
struct island *is, *is_join;
/* Initialise dsf. */
- for (i = 0; i < wh; i++)
- dsf[i] = i;
+ dsf_init(dsf, wh);
/* For each island, find connected islands right or down
* and merge the dsf for the island squares as well as the
ret->solved = ret->completed = 0;
ret->solver = snew(struct solver_state);
- ret->solver->dsf = snewn(wh, int);
+ ret->solver->dsf = snew_dsf(wh);
ret->solver->tmpdsf = snewn(wh, int);
- for (i = 0; i < wh; i++) ret->solver->dsf[i] = i;
ret->solver->refcount = 1;
draw_update(dr, ox, oy, TILE_SIZE, TILE_SIZE);
}
-#define ISLAND_RADIUS ((TILE_SIZE*13)/20)
+#define ISLAND_RADIUS ((TILE_SIZE*12)/20)
#define ISLAND_NUMSIZE(is) \
- (((is)->count < 10) ? TILE_SIZE : (TILE_SIZE*8)/10)
+ (((is)->count < 10) ? (TILE_SIZE*7)/10 : (TILE_SIZE*5)/10)
static void island_redraw(drawing *dr,
game_state *state, game_drawstate *ds,
#endif
const struct game thegame = {
- "Bridges", "games.bridges",
+ "Bridges", "games.bridges", "bridges",
default_params,
game_fetch_preset,
decode_params,