I'm not followinf no more

This commit is contained in:
Sunny
2025-11-26 11:07:07 -05:00
parent 21e15ec5a0
commit 5e8e158d6b
2 changed files with 26 additions and 9 deletions

View File

@@ -1 +1 @@
Press any key to continue . . .
Press any key to continue . . .

View File

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