-static int arr_width;
-static int arr_height;
-static int count;
-
-static cell *arr;
-static cell *head;
-static cell *tail;
-static int blastcount;
-
-static Display *display;
-static Window window;
-static GC *coloredGCs;
-
-static int windowWidth;
-static int windowHeight;
-static int xOffset;
-static int yOffset;
-static int xSize;
-static int ySize;
-
-static FLOAT orthlim = 1.0;
-static FLOAT diaglim;
-static FLOAT anychan;
-static FLOAT minorchan;
-static FLOAT instantdeathchan;
-static int minlifespan;
-static int maxlifespan;
-static FLOAT minlifespeed;
-static FLOAT maxlifespeed;
-static FLOAT mindeathspeed;
-static FLOAT maxdeathspeed;
-static Bool originalcolors;
-
-#define cell_x(c) (((c) - arr) % arr_width)
-#define cell_y(c) (((c) - arr) / arr_width)
-
-
-static int random_life_value (void)
+struct state {
+ Display *dpy;
+ Window window;
+
+ int arr_width;
+ int arr_height;
+ int count;
+
+ cell *arr;
+ cell *head;
+ cell *tail;
+ int blastcount;
+
+ GC *coloredGCs;
+
+ int windowWidth;
+ int windowHeight;
+ int xOffset;
+ int yOffset;
+ int xSize;
+ int ySize;
+
+ FLOAT orthlim;
+ FLOAT diaglim;
+ FLOAT anychan;
+ FLOAT minorchan;
+ FLOAT instantdeathchan;
+ int minlifespan;
+ int maxlifespan;
+ FLOAT minlifespeed;
+ FLOAT maxlifespeed;
+ FLOAT mindeathspeed;
+ FLOAT maxdeathspeed;
+ Bool originalcolors;
+
+ int warned;
+ int delay;
+};
+
+
+#define cell_x(c) (st->arr_width ? ((c) - st->arr) % st->arr_width : 0)
+#define cell_y(c) (st->arr_width ? ((c) - st->arr) / st->arr_width : 0)
+
+
+static int random_life_value (struct state *st)