modification de la validation de l'anti-diagonale ainsi qu'ajouts de pauses dans le menu Thème pour pouvoir nettoyer le terminal après chaque choix

This commit is contained in:
Lea
2025-12-07 12:02:32 -05:00
parent 632d4b332c
commit e56f2039bf

View File

@@ -186,6 +186,7 @@ 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;
string grid02 = grid[0][2]; // Pour pouvoir d<>marrer la diagonale 02, 11, 20
if (compteur == max) { if (compteur == max) {
return true; return true;
} }
@@ -246,13 +247,13 @@ bool verifFinMatch(std::string grid[][LARGTIC], int compteur) {
// Valide diagonale 02, 11, 20 // Valide diagonale 02, 11, 20
fin = true; fin = true;
for (int i = 2; i > 0; i--) { for (int i = 0; i < 3; i++) {
if (grid[i][2-i] == "") { if (grid[i][2-i] == "") {
fin = false; fin = false;
} }
else { else {
fin = fin && (grid[i][2 - i] == grid[2-i][i]); fin = fin && (grid[i][2 - i] == grid02);
cout << "V<EFBFBD>rification de " << i << "," << 2 - i << " et " << 2 - i << "," << i << endl; cout << "comparaison de " << i << "," << 2 - i << " et " << 0 << "," << 2 << endl;
} }
} }