-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.h
26 lines (23 loc) · 1.16 KB
/
structs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef LIBS_GAME_STRUCTS_H_INCLUDED
#define LIBS_GAME_STRUCTS_H_INCLUDED
/**
* @struct TGame
* @brief Represents a Conway's Game of Life structure.
*
* This structure represents a Conway's Game of Life in which the cells moves
* are recorded. It contains a dashboard, which is a 2D array representing the
* game board, as well as other properties such as the number of rows and
* columns in the dashboard, and the values to represent alive and dead cells.
*/
typedef struct {
char **dashboard; /** Board (2D array) in which the cells moves. */
int rows; /** Number of rows in `dashboard`. */
int cols; /** Number of columns in `dashboard`. */
int center[2]; /** Array (row, and column) representing the center of the `dashboard`. */
int cellsAlive; /** Number of alive cells. */
int cellsDead; /** Number of dead cells. */
int generation; /** Represents the generation number. */
int maximumGeneration; /** Maximum number of generations to be processed. */
int delayBetweenGenerations; /** Delay time in milliseconds for processed the next generation.*/
} TGame;
#endif // LIBS_GAME_STRUCTS_H_INCLUDED