Compare commits

..

3 Commits

Author SHA1 Message Date
Sunny
3ba6f53adf IDC ATP 2025-11-26 09:14:03 -05:00
Sunny
eb7e074ac4 IDC ATP 2025-11-26 09:07:34 -05:00
Sunny
04ba078587 all of it lol 2025-11-26 09:06:07 -05:00
4 changed files with 55 additions and 9 deletions

View File

@@ -1 +1 @@
Appuyez sur une touche pour continuer...
Press any key to continue . . .

View File

@@ -17,6 +17,7 @@ using namespace std;
extern const int LARGTIC;
const string ICONJ1 = { "X" };
const string ICONJ2 = { "O" };
const string DEFAULT = { " " };
int codeConsole = 0;
fstream monFlux;
@@ -85,6 +86,10 @@ void afficherImageMenu(std::fstream& monFlux) {
}
//G<>n<EFBFBD>ral (plusieurs options)
void initTab(string grid[][LARGTIC]) {
}
void afficherImageTableau(std::string grid[][LARGTIC]) {
SetConsoleOutputCP(CP_UTF8);
string emoteUp,
@@ -237,20 +242,39 @@ bool verifFinMatch(std::string grid[][LARGTIC]) {
}
}
void afficherFinMatch(string grid[][LARGTIC], int gagnant, int nbJoueurs) {
if (nbJoueurs == 1) {
if (gagnant == 1) {
cout << "\n\nLe joueur a gagne la partie!";
}
else {
cout << "\n\nL'ordinateur a gagne la partie!";
}
}
else {
cout << "\n\nLe joueur " << gagnant
<< " a gagne la partie!";
}
}
//1 joueur
void jeuUnJoueur(string grid[][LARGTIC]) {
bool fin;
int gagnant;
int nbJoueurs = 1;
cout << "\nUn joueur a ete choisi. Le joueur joue en premier.\n\n";
do {
tourJoueur(grid, 1);
gagnant = 1;
fin = verifFinMatch(grid);
tourOrdi(grid);
gagnant = 2;
system("PAUSE>0");
fin = verifFinMatch(grid);
} while (fin != true);
cout << endl << "Termine" << endl;
system("PAUSE");
afficherFinMatch(grid, gagnant, nbJoueurs);
}
void tourOrdi(string grid[][LARGTIC]) {
@@ -269,16 +293,29 @@ void tourOrdi(string grid[][LARGTIC]) {
//2 joueurs
void jeuDeuxJoueurs(string grid[][LARGTIC]) {
bool fin;
int gagnant;
int nbJoueurs = 2;
cout << endl << "Deux joueurs a ete choisi. Les tours seront l'un a la suite de l'autre." << endl << endl;
do {
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
} while (fin != true);
cout << endl << "Termine" << endl;
system("PAUSE");
afficherFinMatch(grid, gagnant, nbJoueurs);
}
//Historique
void historiqueDesScores() {
}
//Changer le th<74>me
void changerLeTheme() {
}

View File

@@ -21,9 +21,11 @@ void afficherMenu(char& choix);
void afficherImageMenu(std::fstream& monFlux);
//G<>n<EFBFBD>ral
void initTab(std::string grid[][LARGTIC]);
void afficherImageTableau(std::string grid[][LARGTIC]);
void tourJoueur(std::string grid[][LARGTIC], int joueur); //pour savoir quel icon utiliser
bool verifFinMatch(std::string grid[][LARGTIC]);
void afficherFinMatch(std::string grid[][LARGTIC], int gagnant, int nbJoueurs);
//1 joueur
void jeuUnJoueur(std::string grid[][LARGTIC]);
@@ -31,3 +33,9 @@ void tourOrdi(std::string grid[][LARGTIC]);
//2 joueurs
void jeuDeuxJoueurs(std::string grid[][LARGTIC]);
//Historique
void historiqueDesScores();
//Changer le th<74>me
void changerLeTheme();

View File

@@ -20,6 +20,7 @@ int main() {
string grid[LARGTIC][LARGTIC] = { " ", " ", " "," ", " ", " ", " ", " ", " " };
do {
initTab(grid);
afficherMenu(choix);
switch (choix) {
@@ -34,11 +35,11 @@ int main() {
break;
case 'C':
historiqueDesScores();
break;
case 'D':
changerLeTheme();
break;
case 'Q':