From 74f5a947b9d9a4f00fa1172f3fd580f90cecbf0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophyl=20Hoguet?= Date: Fri, 21 Jan 2022 23:54:39 +0100 Subject: [PATCH] +=2 on game.c --- game.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game.c b/game.c index 8055bf3..7bb2e2e 100644 --- a/game.c +++ b/game.c @@ -199,7 +199,7 @@ void update_flags_lightbulb(game g, uint i, uint j) { for (int gap_position = 1; gap_position < max(game_nb_cols(g), game_nb_rows(g)); gap_position++) { // index_tab => pair = i // index_tab => odd = j - for (uint index_tab = 0; index_tab < sizeof(tab) / sizeof(tab[0]) - 1; index_tab += 2) { + for (uint index_tab = 0; index_tab < sizeof(tab) / sizeof(tab[0]); index_tab += 2) { // big if to check if INORMAL and JNORMAL are correct or if wrapping is true and IWRAPPING and JWRAPPING are not the initial case if (/* test if both tab are not 0*/ tab[index_tab] != tab[index_tab + 1] && (/* normal check */ (JNORMAL >= 0 && JNORMAL < game_nb_cols(g) && INORMAL >= 0 && INORMAL < game_nb_rows(g)) || @@ -223,7 +223,7 @@ void update_flags_walls(game g, uint i, uint j) { int lightbulb = 0; int not_empty = 0; int tab[] = {-1, 0, 1, 0, 0, -1, 0, 1}; - for (uint index_tab = 0; index_tab < (sizeof(tab) / sizeof(tab[0])); index_tab = index_tab + 2) { + for (uint index_tab = 0; index_tab < (sizeof(tab) / sizeof(tab[0])); index_tab += 2) { uint gap_position = 1; if (/* normal check*/ (JNORMAL >= 0 && JNORMAL < game_nb_cols(g) && INORMAL >= 0 && INORMAL < game_nb_rows(g)) || /*wrapping check*/ (game_is_wrapping(g) &&