+set_up_board (void)
+{
+ guint x, y;
+
+ if (current_state==STATE_PLAYING)
+ {
+ /* end of the game; clean up */
+
+ for (x=0; x < ARENA_WIDTH; x++)
+ for (y=0; y < ARENA_HEIGHT; y++)
+ if (arena[x][y])
+ {
+ gtk_container_remove (GTK_CONTAINER (state_widget[STATE_PLAYING]),
+ arena[x][y]);
+ arena[x][y] = NULL;
+ }
+
+ g_object_unref (robot);
+ g_object_unref (kitten);
+ }
+ else
+ {
+ /* make everything new */
+
+ robot = gtk_label_new ("#");
+ g_object_ref (robot);
+ kitten = random_character ("You found kitten! Way to go, robot!");
+ g_object_ref (kitten);
+
+ place_in_arena_randomly (robot);
+ place_in_arena_randomly (kitten);
+
+ if (nki_count < amount_of_random_stuff)
+ {
+ /* sanity check failed */
+ show_message ("There are too few non-kitten items to play a meaningful game.");
+ exit (EXIT_FAILURE);
+ }
+
+ for (x=0; x < amount_of_random_stuff; x++)
+ place_in_arena_randomly (random_character (description ()));
+
+ for (x=0; x < ARENA_WIDTH; x++)
+ for (y=0; y < ARENA_HEIGHT; y++)
+ if (!arena[x][y])
+ place_in_arena_at_xy (gtk_label_new (NULL), x, y);
+ }
+}
+
+static void