Compare commits
2 Commits
ffe4af9f93
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b488389d8a | ||
|
|
c928b9483d |
@@ -275,18 +275,30 @@ void afficherFinMatch(string grid[][LARGTIC], int gagnant, int nbJoueurs) {
|
|||||||
cout << "\n\nPartie nulle!";
|
cout << "\n\nPartie nulle!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (nbJoueurs == 2){
|
||||||
|
if (gagnant == 1) {
|
||||||
|
cout << "\n\nJoueur 1 a gagne la partie!";
|
||||||
|
}
|
||||||
|
else if (gagnant == 2) {
|
||||||
|
cout << "\n\nJoueur 2 a gagne la partie!";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cout << "\n\nPartie nulle!";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int partieNulle(string grid[][LARGTIC], int compteur) {
|
int partieNulle(string grid[][LARGTIC], int compteur) {
|
||||||
int max = LARGTIC * LARGTIC;
|
int max = LARGTIC * LARGTIC;
|
||||||
|
int temp = gagnant;
|
||||||
if (compteur == max) {
|
if (compteur == max) {
|
||||||
gagnant = 3;
|
gagnant = 3;
|
||||||
return gagnant;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gagnant = 1;
|
gagnant = temp;
|
||||||
return gagnant;
|
|
||||||
}
|
}
|
||||||
|
return gagnant;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Joueur
|
// Joueur
|
||||||
@@ -341,7 +353,6 @@ void tourJoueur(string grid[][LARGTIC], int joueur) {
|
|||||||
//1 joueur
|
//1 joueur
|
||||||
void jeuUnJoueur(string grid[][LARGTIC]) {
|
void jeuUnJoueur(string grid[][LARGTIC]) {
|
||||||
bool fin;
|
bool fin;
|
||||||
int gagnant = 1;
|
|
||||||
int nbJoueurs = 1;
|
int nbJoueurs = 1;
|
||||||
int compteur = 0;
|
int compteur = 0;
|
||||||
|
|
||||||
@@ -381,7 +392,6 @@ void tourOrdi(string grid[][LARGTIC]) {
|
|||||||
//2 joueurs
|
//2 joueurs
|
||||||
void jeuDeuxJoueurs(string grid[][LARGTIC]) {
|
void jeuDeuxJoueurs(string grid[][LARGTIC]) {
|
||||||
bool fin;
|
bool fin;
|
||||||
int gagnant = 1;
|
|
||||||
int nbJoueurs = 2;
|
int nbJoueurs = 2;
|
||||||
int compteur = 0;
|
int compteur = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -21,23 +21,23 @@ int main() {
|
|||||||
afficherMenu(choix);
|
afficherMenu(choix);
|
||||||
|
|
||||||
switch (choix) {
|
switch (choix) {
|
||||||
case 'A':
|
case 'A':
|
||||||
system("cls");
|
system("cls");
|
||||||
jeuUnJoueur(grid);
|
jeuUnJoueur(grid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'B':
|
case 'B':
|
||||||
system("cls");
|
system("cls");
|
||||||
jeuDeuxJoueurs(grid);
|
jeuDeuxJoueurs(grid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'C':
|
case 'C':
|
||||||
changerLeTheme();
|
changerLeTheme();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Q':
|
case 'Q':
|
||||||
cout << "\nAu revoir!";
|
cout << "\nAu revoir!";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
cout << endl << "Saisissez un choix valide." << endl;
|
cout << endl << "Saisissez un choix valide." << endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user