change struct start new empty ext

This commit is contained in:
Théophyl Hoguet committed 2021-12-09 11:11:33 +01:00
1 parent 0c17df162c
commit 497d6022c0
2 files changed
+8 -1

No files matched your search

+6
View File
@@ -4,6 +4,9 @@
struct game_s { struct game_s {
square** tab_cell; square** tab_cell;
bool wrapped;
uint height;
uint width;
}; };
game game_new(square* squares) { game game_new(square* squares) {
@@ -37,6 +40,9 @@ game game_new_empty(void) {
g->tab_cell[i][j] = S_BLANK; g->tab_cell[i][j] = S_BLANK;
} }
} }
g->wrapped = false;
g->height = DEFAULT_SIZE;
g->width = DEFAULT_SIZE;
return g; return g;
} }
+2 -1
View File
@@ -1,8 +1,9 @@
#include "game_ext.h" #include "game_ext.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
game game_new_ext(uint nb_rows, uint nb_cols, square* squares, bool wrapping) { 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) { game game_new_empty_ext(uint nb_rows, uint nb_cols, bool wrapping) {