#ifndef GOL_ARRAY_H #define GOL_ARRAY_H #include /* * Represents a state of the Game of Life. The coordinates of all live cells * is stored in an array: [x1, y1, x2, y2, x3, y3,...]. N is the number of * live cells, size is the size of the array. */ struct gol_board { int_least32_t *live_cells; uint_least32_t n; uint_least32_t size; int_least32_t max_x; int_least32_t min_x; int_least32_t max_y; int_least32_t min_y; }; /* * Check that a cell located at (x,y) in the game board is live. */ int gol_is_live(struct gol_board *state, int_least32_t x, int_least32_t y, char *is_live); /* * Append the coordinates of the live cell to the array. */ int gol_vivify(struct gol_board *state, int_least32_t x, int_least32_t y); #endif