modification de la vérification de la fin de match avec un compteur
This commit is contained in:
@@ -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,12 +249,11 @@ 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) {
|
||||||
afficherImageTableau(grid, style);
|
afficherImageTableau(grid, style);
|
||||||
|
|||||||
Reference in New Issue
Block a user