changement de conflits

This commit is contained in:
Lea
2025-11-26 11:11:11 -05:00

View File

@@ -15,9 +15,9 @@ BUT : Fichier de fonctions Tic Tac Toe
using namespace std; using namespace std;
extern const int LARGTIC; extern const int LARGTIC;
string ICONJ1 = "X"; string ICONJ1 = "X";
string ICONJ2 = "O"; string ICONJ2 = "O";
string style = "themes/themeSea.txt"; string style = "themes/themeSea.txt";
int codeConsole = 0; int codeConsole = 0;
fstream monFlux; fstream monFlux;
@@ -175,10 +175,26 @@ void tourJoueur(string grid[][LARGTIC], int joueur) {
cout << "\n\nEntrez une coordonnee verticale : "; cout << "\n\nEntrez une coordonnee verticale : ";
cin >> verticale; cin >> verticale;
while (verticale < 1 || verticale > 3) {
cout << "\n\nVeuillez entrer une donnee valide.\n"
<< "\n\nEntrez une coordonnee verticale : ";
cin >> verticale;
}
cout << "\nEntrez une coordonnee horizontale : "; cout << "\nEntrez une coordonnee horizontale : ";
cin >> horizontale; cin >> horizontale;
while (grid[verticale - 1][horizontale - 1] == ICONJ1 || grid[verticale - 1][horizontale - 1] == ICONJ2) { while (horizontale < 1 || horizontale > 3) {
cout << "\n\nVeuillez entrer une donnee valide.\n"
<< "\n\nEntrez une coordonnee horizontale : ";
cin >> horizontale;
}
verticale -= 1;
horizontale -= 1;
while (grid[verticale][horizontale] == ICONJ1 || grid[verticale][horizontale] == ICONJ2) {
cout << "\n\nVeuillez choisir une case vide.\n" cout << "\n\nVeuillez choisir une case vide.\n"
<< "\n\nEntrez une coordonnee verticale : "; << "\n\nEntrez une coordonnee verticale : ";
cin >> verticale; cin >> verticale;
@@ -321,10 +337,11 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) {
tourJoueur(grid, 1); tourJoueur(grid, 1);
gagnant = 1; gagnant = 1;
fin = verifFinMatch(grid); fin = verifFinMatch(grid);
tourJoueur(grid, 2); if (fin != true) {
gagnant = 2; tourJoueur(grid, 2);
fin = verifFinMatch(grid); gagnant = 2;
// la condition doit <20>tre une s<>rie de 3 symboles pareil fin = verifFinMatch(grid);
}
} while (fin != true); } while (fin != true);
afficherFinMatch(grid, gagnant, nbJoueurs); afficherFinMatch(grid, gagnant, nbJoueurs);
} }