+ printf("%6s %2d\n", colors[tile.color], tile.number + 1);
+}
+
+static void tile_draw(game_t *game, tile_t *tile, cairo_t *cr)
+{
+ char number_string[3];
+ int len;
+
+ len = snprintf (number_string, 3, "%d", tile->number + 1);
+ if (len < 0 || len >= 3)
+ FATAL_ERROR ("snprintf failed");
+
+ cairo_save(cr);
+ cairo_translate(cr, tile->x, tile->y);
+ rsvg_handle_render_cairo (game->blanktile, cr);
+
+ if (tile->color == BLACK)
+ cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
+ if (tile->color == BLUE)
+ cairo_set_source_rgb (cr, 0.0, 0.0, 1.0);
+ if (tile->color == RED)
+ cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);
+ if (tile->color == YELLOW)
+ cairo_set_source_rgb (cr, 1.0, .843, 0.0);
+ cairo_move_to (cr, 10, 25);
+ cairo_set_font_size(cr, 25);
+ cairo_show_text (cr, number_string);
+
+ cairo_restore(cr);
+}
+
+static void tile_group_init(tile_group_t *tile_group)
+{
+ tile_group->num_tiles = 0;