From 008f2a3329e3fe511c77943d5a385bb751075936 Mon Sep 17 00:00:00 2001 From: Lea Date: Fri, 5 Dec 2025 09:51:40 -0500 Subject: [PATCH] =?UTF-8?q?l'affichage=20de=20partie=20nulle=20fonctionne,?= =?UTF-8?q?=20mais=20le=20vainqueur=20est=20affich=C3=A9=20comme=20=C3=A9t?= =?UTF-8?q?ant=20joueur=209?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TicTacToe/fonctions.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/TicTacToe/fonctions.cpp b/TicTacToe/fonctions.cpp index 82e2c5c..932f065 100644 --- a/TicTacToe/fonctions.cpp +++ b/TicTacToe/fonctions.cpp @@ -190,7 +190,6 @@ bool verifFinMatch(std::string grid[][LARGTIC], int compteur) { return true; } else { - compteur++; // Valide horizontales 00, 01, 02 || 10, 11, 12 || 20, 21, 22 for (int i = 0; i < LARGTIC; i++) { fin = true; @@ -356,15 +355,17 @@ void jeuUnJoueur(string grid[][LARGTIC]) { do { tourJoueur(grid, 1); gagnant = 1; + compteur++; fin = verifFinMatch(grid, compteur); - gagnant = partieNulle(grid, compteur); if (fin != true) { tourOrdi(grid); gagnant = 2; system("PAUSE>nul"); + compteur++; fin = verifFinMatch(grid, compteur); } } while (fin != true); + gagnant = partieNulle(grid, compteur); afficherFinMatch(grid, gagnant, nbJoueurs); } @@ -394,16 +395,16 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) { do { tourJoueur(grid, 1); gagnant = 1; - fin = verifFinMatch(grid, compteur); compteur++; - gagnant = partieNulle(grid, compteur); + fin = verifFinMatch(grid, compteur); if (fin != true) { tourJoueur(grid, 2); gagnant = 2; - fin = verifFinMatch(grid, compteur); compteur++; + fin = verifFinMatch(grid, compteur); } } while (fin != true); + gagnant = partieNulle(grid, compteur); afficherFinMatch(grid, gagnant, nbJoueurs); }