]> git.friedersdorff.com Git - max/gol.git/blobdiff - array.c
MINIMAL implementation. Single glider gun
[max/gol.git] / array.c
diff --git a/array.c b/array.c
index 469be38b088c646e5b266806c80a40b491747e3c..c70c5707a08a295a5ed600f43073bfdaadd52e18 100644 (file)
--- a/array.c
+++ b/array.c
@@ -38,5 +38,17 @@ int gol_vivify(struct gol_board *const state, int_least32_t x, int_least32_t y)
        state->live_cells[state->n + 1] = y;
 
        state->n += 2;
+
+       if (x > state->max_x) {
+               state->max_x = x;
+       } else if (x < state->min_x) {
+               state->min_x = x;
+       }
+
+       if (y > state->max_y) {
+               state->max_y = y;
+       } else if (y < state->min_y) {
+               state->min_y = y;
+       }
        return 1;
 }