From 78960c6ef989467a89f3f4abb860b63247b026dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophyl=20Hoguet?= Date: Tue, 11 Jan 2022 23:05:58 +0100 Subject: [PATCH] Lenght commit message fixed as been fixed --- game.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/game.c b/game.c index d68a5f9..928a4cd 100644 --- a/game.c +++ b/game.c @@ -198,8 +198,9 @@ void game_update_flags(game g) { if (/* test if both tab are not 0*/ tab[y] != tab[y + 1] && (/* normal check */ (j + x * tab[y + 1] >= 0 && j + x * tab[y + 1] < g->width && i + x * tab[y] >= 0 && i + x * tab[y] < g->height) || - /* wrapping check*/ ( - g->wrapping && !((((i + g->height + x * tab[y]) % g->height) == i) && (((j + g->width + x * tab[y + 1]) % g->width) == j))))) { + /* wrapping check*/ (g->wrapping && + /*not the same case*/ !((((i + g->height + x * tab[y]) % g->height) == i) && + (((j + g->width + x * tab[y + 1]) % g->width) == j))))) { if (game_is_black(g, ((i + g->height + x * tab[y]) % g->height), ((j + g->width + x * tab[y + 1]) % g->width))) { tab[y] = 0; tab[y + 1] = 0; @@ -225,8 +226,9 @@ void game_update_flags(game g) { int tab[] = {-1, 0, 1, 0, 0, -1, 0, 1}; for (uint y = 0; y < 7; y = y + 2) { if (/* normal check*/ (j + tab[y + 1] >= 0 && j + tab[y + 1] < g->width && i + tab[y] >= 0 && i + tab[y] < g->height) || - /*wrapping check*/ (g->wrapping && - !((((i + g->height + tab[y]) % g->height) == i) && (((j + g->width + tab[y + 1]) % g->width) == j)))) { + /*wrapping check*/ ( + g->wrapping && + /*not the same case*/ !((((i + g->height + tab[y]) % g->height) == i) && (((j + g->width + tab[y + 1]) % g->width) == j)))) { if (game_is_lightbulb(g, (i + g->height + tab[y]) % g->height, (j + g->width + tab[y + 1]) % g->width)) lb++; else if (!game_is_blank(g, (i + g->height + tab[y]) % g->height, (j + g->width + tab[y + 1]) % g->width) ||