+ return TRUE;
+}
+
+static void game_print_size(const game_params *params, float *x, float *y)
+{
+ int pw, ph;
+
+ /*
+ * I'll use 5mm squares by default.
+ */
+ game_compute_size(params, 500, &pw, &ph);
+ *x = pw / 100.0F;
+ *y = ph / 100.0F;
+}
+
+static void game_print(drawing *dr, const game_state *state, int tilesize)
+{
+ int w = state->w, h = state->h;
+ int ink = print_mono_colour(dr, 0);
+ int x, y;
+
+ /* Ick: fake up `ds->tilesize' for macro expansion purposes */
+ game_drawstate ads, *ds = &ads;
+ game_set_size(dr, ds, NULL, tilesize);
+
+ /*
+ * Border.
+ */
+ print_line_width(dr, TILE_SIZE / 10);
+ draw_rect_outline(dr, COORD(0), COORD(0), w*TILE_SIZE, h*TILE_SIZE, ink);
+
+ /*
+ * Grid. We have to make the grid lines particularly thin,
+ * because users will be drawing lines _along_ them and we want
+ * those lines to be visible.
+ */
+ print_line_width(dr, TILE_SIZE / 256);
+ for (x = 1; x < w; x++)
+ draw_line(dr, COORD(x), COORD(0), COORD(x), COORD(h), ink);
+ for (y = 1; y < h; y++)
+ draw_line(dr, COORD(0), COORD(y), COORD(w), COORD(y), ink);
+
+ /*
+ * Solution.
+ */
+ print_line_width(dr, TILE_SIZE / 10);
+ for (y = 0; y <= h; y++)
+ for (x = 0; x <= w; x++) {
+ if (HRANGE(state,x,y) && hedge(state,x,y))
+ draw_line(dr, COORD(x), COORD(y), COORD(x+1), COORD(y), ink);
+ if (VRANGE(state,x,y) && vedge(state,x,y))
+ draw_line(dr, COORD(x), COORD(y), COORD(x), COORD(y+1), ink);
+ }
+
+ /*
+ * Clues.
+ */
+ for (y = 0; y < h; y++)
+ for (x = 0; x < w; x++)
+ if (grid(state,x,y)) {
+ char str[80];
+ sprintf(str, "%d", grid(state,x,y));
+ draw_text(dr, COORD(x)+TILE_SIZE/2, COORD(y)+TILE_SIZE/2,
+ FONT_VARIABLE, TILE_SIZE/2,
+ ALIGN_HCENTRE | ALIGN_VCENTRE, ink, str);
+ }