* Establish a disjoint set forest for tracking connectedness
* between grid points.
*/
- for (i = 0; i < W*H; i++)
- sc->connected[i] = i; /* initially all distinct */
+ dsf_init(sc->connected, W*H);
/*
* Establish a disjoint set forest for tracking which squares
* are known to slant in the same direction.
*/
- for (i = 0; i < w*h; i++)
- sc->equiv[i] = i; /* initially all distinct */
+ dsf_init(sc->equiv, w*h);
/*
* Clear the slashval array.
* Establish a disjoint set forest for tracking connectedness
* between grid points.
*/
- connected = snewn(W*H, int);
- for (i = 0; i < W*H; i++)
- connected[i] = i; /* initially all distinct */
+ connected = snew_dsf(W*H);
/*
* Prepare a list of the squares in the grid, and fill them in
* edge is visited at most twice.
*/
dsf = state->clues->tmpdsf;
- for (i = 0; i < W*H; i++)
- dsf[i] = i; /* initially all distinct */
+ dsf_init(dsf, W*H);
for (y = 0; y < h; y++)
for (x = 0; x < w; x++) {
int i1, i2;
return move;
}
+static int game_can_format_as_text_now(game_params *params)
+{
+ return TRUE;
+}
+
static char *game_text_format(game_state *state)
{
int w = state->p.w, h = state->p.h, W = w+1, H = h+1;
int *x, int *y)
{
/* fool the macros */
- struct dummy { int tilesize; } dummy = { tilesize }, *ds = &dummy;
+ struct dummy { int tilesize; } dummy, *ds = &dummy;
+ dummy.tilesize = tilesize;
*x = 2 * BORDER + params->w * TILESIZE + 1;
*y = 2 * BORDER + params->h * TILESIZE + 1;
#endif
const struct game thegame = {
- "Slant", "games.slant",
+ "Slant", "games.slant", "slant",
default_params,
game_fetch_preset,
decode_params,
dup_game,
free_game,
TRUE, solve_game,
- TRUE, game_text_format,
+ TRUE, game_can_format_as_text_now, game_text_format,
new_ui,
free_ui,
encode_ui,