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

Correction de la fonction get_grid

parent 81adeeab
Branches
No related merge requests found
...@@ -62,5 +62,9 @@ struct Grid* grid_new(int x, int y) ...@@ -62,5 +62,9 @@ struct Grid* grid_new(int x, int y)
enum CaseType get_grid(struct Grid* grid, int x, int y) enum CaseType get_grid(struct Grid* grid, int x, int y)
{ {
return grid->game_grid[coordonner_vers_indice(x, y, grid)]; if (0 <= x && x <grid->column_number && 0 <= y && y <grid->row_number )
{
return grid->game_grid[coordonner_vers_indice(x, y, grid)];
}
else{return -1;}
} }
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