modification de la vérification de la fin de match avec un compteur

This commit is contained in:
Lea
2025-12-05 08:30:54 -05:00
parent 1d28babc6e
commit 763aba1a13

View File

@@ -185,7 +185,14 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) {
bool verifFinMatch(std::string grid[][LARGTIC]) { bool verifFinMatch(std::string grid[][LARGTIC]) {
bool fin = false; bool fin = false;
int max = LARGTIC * LARGTIC;
int compteur = 0;
if (compteur == max) {
return true;
}
else {
compteur++;
// Valide horizontales // Valide horizontales
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
fin = true; fin = true;
@@ -242,11 +249,10 @@ bool verifFinMatch(std::string grid[][LARGTIC]) {
} }
} }
if (fin == true) { if (fin == true) {
return fin; return fin;
} }
}
} }
void afficherFinMatch(string grid[][LARGTIC], int gagnant, int nbJoueurs) { void afficherFinMatch(string grid[][LARGTIC], int gagnant, int nbJoueurs) {