fonction init

This commit is contained in:
Sunny
2025-11-26 09:35:01 -05:00
parent 3ba6f53adf
commit 078a2516e2
2 changed files with 13 additions and 7 deletions

View File

@@ -87,7 +87,11 @@ void afficherImageMenu(std::fstream& monFlux) {
//G<>n<EFBFBD>ral (plusieurs options) //G<>n<EFBFBD>ral (plusieurs options)
void initTab(string grid[][LARGTIC]) { void initTab(string grid[][LARGTIC]) {
for (int i = 0; i < LARGTIC; i++) {
for (int j = 0; j < LARGTIC; i++) {
grid[i][j] = " ";
}
}
} }
void afficherImageTableau(std::string grid[][LARGTIC]) { void afficherImageTableau(std::string grid[][LARGTIC]) {
@@ -269,10 +273,12 @@ void jeuUnJoueur(string grid[][LARGTIC]) {
tourJoueur(grid, 1); tourJoueur(grid, 1);
gagnant = 1; gagnant = 1;
fin = verifFinMatch(grid); fin = verifFinMatch(grid);
if (fin != true) {
tourOrdi(grid); tourOrdi(grid);
gagnant = 2; gagnant = 2;
system("PAUSE>0"); system("PAUSE>0");
fin = verifFinMatch(grid); fin = verifFinMatch(grid);
}
} while (fin != true); } while (fin != true);
afficherFinMatch(grid, gagnant, nbJoueurs); afficherFinMatch(grid, gagnant, nbJoueurs);
} }
@@ -296,7 +302,7 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) {
int gagnant; int gagnant;
int nbJoueurs = 2; int nbJoueurs = 2;
cout << endl << "Deux joueurs a ete choisi. Les tours seront l'un a la suite de l'autre." << endl << endl; cout << "\nDeux joueurs a ete choisi. Les tours seront l'un a la suite de l'autre.\n\n";
do { do {
tourJoueur(grid, 1); tourJoueur(grid, 1);