From 497d6022c02bb1e2bf0dba6b0441eff9097f26c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophyl=20Hoguet?= Date: Thu, 9 Dec 2021 11:11:33 +0100 Subject: [PATCH] change struct start new empty ext --- game.c | 6 ++++++ game_ext.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/game.c b/game.c index ff550ba..4fa1b7c 100644 --- a/game.c +++ b/game.c @@ -4,6 +4,9 @@ struct game_s { square** tab_cell; + bool wrapped; + uint height; + uint width; }; game game_new(square* squares) { @@ -37,6 +40,9 @@ game game_new_empty(void) { g->tab_cell[i][j] = S_BLANK; } } + g->wrapped = false; + g->height = DEFAULT_SIZE; + g->width = DEFAULT_SIZE; return g; } diff --git a/game_ext.c b/game_ext.c index 4e21273..a7dcde0 100644 --- a/game_ext.c +++ b/game_ext.c @@ -1,8 +1,9 @@ #include "game_ext.h" #include +#include game game_new_ext(uint nb_rows, uint nb_cols, square* squares, bool wrapping) { - return; + game g = (game)malloc(sizeof(struct game_s)); } game game_new_empty_ext(uint nb_rows, uint nb_cols, bool wrapping) {