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); }