From a72da69ea7e54f78ff0939359d17ea0272b5ef3d Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 5 Dec 2025 09:51:51 -0500 Subject: [PATCH] Work --- TicTacToe/fonctions.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TicTacToe/fonctions.cpp b/TicTacToe/fonctions.cpp index 82e2c5c..ff2005e 100644 --- a/TicTacToe/fonctions.cpp +++ b/TicTacToe/fonctions.cpp @@ -186,11 +186,11 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) { bool verifFinMatch(std::string grid[][LARGTIC], int compteur) { bool fin = false; int max = LARGTIC * LARGTIC; + if (compteur == max) { return true; } else { - compteur++; // Valide horizontales 00, 01, 02 || 10, 11, 12 || 20, 21, 22 for (int i = 0; i < LARGTIC; i++) { fin = true; @@ -396,7 +396,7 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) { gagnant = 1; fin = verifFinMatch(grid, compteur); compteur++; - gagnant = partieNulle(grid, compteur); + if (fin != true) { tourJoueur(grid, 2); gagnant = 2; @@ -404,6 +404,7 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) { compteur++; } } while (fin != true); + gagnant = partieNulle(grid, compteur); afficherFinMatch(grid, gagnant, nbJoueurs); }