+static void
+init_spinners (m_state *state)
+{
+ int i = get_integer_resource ("spinners", "Integer");
+ int x, y;
+ m_cell *cell;
+
+ for (y = 0; y < state->grid_height; y++)
+ for (x = 0; x < state->grid_width; x++)
+ {
+ cell = &state->cells[state->grid_width * y + x];
+ cell->spinner = 0;
+ }
+
+ while (--i > 0)
+ {
+ x = random() % state->grid_width;
+ y = random() % state->grid_height;
+ cell = &state->cells[state->grid_width * y + x];
+ cell->spinner = 1;
+ }
+}
+
+