all of it lol
This commit is contained in:
@@ -1 +1 @@
|
||||
Appuyez sur une touche pour continuer...
|
||||
Press any key to continue . . .
|
||||
|
||||
@@ -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,11 @@ void afficherImageMenu(std::fstream& monFlux) {
|
||||
}
|
||||
|
||||
//G<>n<EFBFBD>ral (plusieurs options)
|
||||
void initTab(string grid[][LARGTIC]) {
|
||||
grid[LARGTIC][LARGTIC];
|
||||
|
||||
}
|
||||
|
||||
void afficherImageTableau(std::string grid[][LARGTIC]) {
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
string emoteUp,
|
||||
@@ -215,18 +221,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);
|
||||
//fin = verifFinMatch(grid);
|
||||
gagnant = 1;
|
||||
fin = verifFinMatch(grid);
|
||||
tourOrdi(grid);
|
||||
gagnant = 2;
|
||||
system("PAUSE>0");
|
||||
fin = verifFinMatch(grid);
|
||||
} while (fin != true);
|
||||
afficherFinMatch(grid, gagnant, nbJoueurs);
|
||||
}
|
||||
|
||||
void tourOrdi(string grid[][LARGTIC]) {
|
||||
@@ -245,12 +272,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);
|
||||
afficherFinMatch(grid, gagnant, nbJoueurs);
|
||||
}
|
||||
|
||||
//Historique
|
||||
void historiqueDesScores() {
|
||||
|
||||
}
|
||||
|
||||
//Changer le th<74>me
|
||||
void changerLeTheme() {
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
@@ -17,9 +17,10 @@ int main() {
|
||||
srand(time(NULL));
|
||||
|
||||
char choix;
|
||||
string grid[LARGTIC][LARGTIC] = { " ", " ", " "," ", " ", " ", " ", " ", " "};
|
||||
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':
|
||||
|
||||
Reference in New Issue
Block a user