Skip to content
Snippets Groups Projects
Commit 2122efb7 authored by Arnaud Albiez's avatar Arnaud Albiez
Browse files

Correction fonction new_grid

parent 775309ef
Branches
No related merge requests found
...@@ -51,12 +51,10 @@ enum CaseType* initialisation_grid(int x, int y) ...@@ -51,12 +51,10 @@ enum CaseType* initialisation_grid(int x, int y)
struct Grid* grid_new(int x, int y) struct Grid* grid_new(int x, int y)
{ {
struct Grid * new_strut_grid = NULL; struct Grid * new_strut_grid = (struct Grid *) malloc(1 * sizeof(struct Grid *));
new_strut_grid = (struct Grid *) malloc(1 * sizeof(struct Grid *));
enum CaseType* new_grid = initialisation_grid(x, y);
new_strut_grid->column_number=x; new_strut_grid->column_number=x;
new_strut_grid->row_number= y; new_strut_grid->row_number= y;
new_strut_grid->game_grid = new_grid; new_strut_grid->game_grid = initialisation_grid(x, y);
return new_strut_grid; return new_strut_grid;
} }
......
...@@ -17,6 +17,7 @@ struct Grid{ ...@@ -17,6 +17,7 @@ struct Grid{
int column_number; ///< Nombre de colonne de game_grid int column_number; ///< Nombre de colonne de game_grid
int row_number; ///< Nomber de ligne de game_grid int row_number; ///< Nomber de ligne de game_grid
}; };
void init_level(const char* file_path); void init_level(const char* file_path);
struct Grid* grid_new(int x, int y); struct Grid* grid_new(int x, int y);
...@@ -27,7 +28,7 @@ void Affichage_grid(struct Grid* grid); ...@@ -27,7 +28,7 @@ void Affichage_grid(struct Grid* grid);
void change_cell_grid(struct Grid* grid, int x, int y, enum CaseType new_valeur); void change_cell_grid(struct Grid* grid, int x, int y, enum CaseType new_valeur);
void free_grid(struct Grid* grid) void free_grid(struct Grid* grid);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment