diff --git a/libs/utilities.c b/libs/utilities.c index 0ce0795..1d1496d 100644 --- a/libs/utilities.c +++ b/libs/utilities.c @@ -1,4 +1,5 @@ #include +#include "utilities.h" int getStrLength(char* str) { int length = 0; @@ -9,4 +10,18 @@ int getStrLength(char* str) { }; return length; -} \ No newline at end of file +} + +void printDashboard(TGame* pGame){ + +int i,j; + +for(i=0;irows;i++){ + for(j=0;jcols; j++){ + printf("%d ",pGame->dashboard[i][j]); + } + printf("\n"); + } + + +} diff --git a/libs/utilities.h b/libs/utilities.h index ccbdd94..fe06429 100644 --- a/libs/utilities.h +++ b/libs/utilities.h @@ -1,6 +1,25 @@ #ifndef UTILITIES_H_INCLUDED #define UTILITIES_H_INCLUDED +#define ROWS 100 +#define COLS 100 + +typedef struct{ + +int dashboard[ROWS][COLS]; +int rows; +int cols; +int cellAlive; +int cellDead; + +}TGame; + + + + + + + /** * @brief Calculates the length of a string. * @@ -17,4 +36,6 @@ */ int getStrLength(char* str); +void printDashboard(TGame* pGame); + #endif // UTILITIES_H_INCLUDED diff --git a/src/main.c b/src/main.c index 49a8b07..e233979 100644 --- a/src/main.c +++ b/src/main.c @@ -4,10 +4,21 @@ #include int main() { - char str[] = "Hello World!"; - int strLength = getStrLength(str); - printf("> The length of the string \"%s\" is %d.", str, strLength); + int dashboard[ROWS][COLS]; + int rows=ROWS; + int cols=COLS; + int cellAlive; + int cellDead; + TGame game; + + game.dashboard=dashboard; + game.rows=rows; + game.cols=cols; + game.cellAlive=cellAlive; + game.cellDead=cellDead; + + printDashboard(&game); return 0; }