This commit is contained in:
Sunny
2025-12-05 09:51:51 -05:00
parent 00217eb38a
commit a72da69ea7

View File

@@ -186,11 +186,11 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) {
bool verifFinMatch(std::string grid[][LARGTIC], int compteur) { bool verifFinMatch(std::string grid[][LARGTIC], int compteur) {
bool fin = false; bool fin = false;
int max = LARGTIC * LARGTIC; int max = LARGTIC * LARGTIC;
if (compteur == max) { if (compteur == max) {
return true; return true;
} }
else { else {
compteur++;
// Valide horizontales 00, 01, 02 || 10, 11, 12 || 20, 21, 22 // Valide horizontales 00, 01, 02 || 10, 11, 12 || 20, 21, 22
for (int i = 0; i < LARGTIC; i++) { for (int i = 0; i < LARGTIC; i++) {
fin = true; fin = true;
@@ -396,7 +396,7 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) {
gagnant = 1; gagnant = 1;
fin = verifFinMatch(grid, compteur); fin = verifFinMatch(grid, compteur);
compteur++; compteur++;
gagnant = partieNulle(grid, compteur);
if (fin != true) { if (fin != true) {
tourJoueur(grid, 2); tourJoueur(grid, 2);
gagnant = 2; gagnant = 2;
@@ -404,6 +404,7 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) {
compteur++; compteur++;
} }
} while (fin != true); } while (fin != true);
gagnant = partieNulle(grid, compteur);
afficherFinMatch(grid, gagnant, nbJoueurs); afficherFinMatch(grid, gagnant, nbJoueurs);
} }