@@ -20,9 +20,10 @@ typedef struct {
2020 char (* dashboard )[DASHBOARD_COLS ]; /** Board (2D array) in which the cells moves. */
2121 int rows ; /** Number of rows in `dashboard`. */
2222 int cols ; /** Number of columns in `dashboard`. */
23- int cellsAlive ; /** Number of alive cells. */
24- int cellsDead ; /** Number of dead cells. */
25- int generation ; /** Represents the generation number. */
23+ int center [2 ]; /** Array (row, and column) representing the center of the `dashboard`. */
24+ int cellsAlive ; /** Number of alive cells. */
25+ int cellsDead ; /** Number of dead cells. */
26+ int generation ; /** Represents the generation number. */
2627} TGame ;
2728
2829/**
@@ -39,12 +40,12 @@ void drawPattern(TGame* pGame, char* pattern);
3940 * @brief Draws a specified pattern on a Conway's Game of Life board.
4041 *
4142 * @param pGame Pointer to the Conway's Game of Life structure where the pattern will be drawn.
42- * @param pattern Pointer to pattern structure to be drawn.
43+ * @param pPattern Pointer to pattern structure to be drawn.
4344 *
4445 * @warning This functions is intended for internal use only and should not be used outside of this
4546 * library.
4647 */
47- void drawPatternInDashboard (TGame * pGame , TPattern * pattern );
48+ void drawPatternInDashboard (TGame * pGame , TPattern * pPattern );
4849
4950/**
5051 * @brief Fills the dashboard of a Conway's Game of Life structure with a
@@ -99,6 +100,16 @@ int isStrIn(char* str, char* arr[], int arrLength);
99100 */
100101void printDashboardByConsole (TGame * pGame );
101102
103+ /**
104+ * @brief Sets the center of a Conway's Game of Life structure.
105+ *
106+ * @param pGame A pointer to the Conway's Game of Life structure.
107+ *
108+ * @warning This function assumes that `pGame` has been properly initialized with valid `rows` and
109+ * `cols` field values.
110+ */
111+ void setDashboardCenter (TGame * pGame );
112+
102113/**
103114 * @brief Compares two strings case-insensitively.
104115 *
0 commit comments