Compare commits

...

6 Commits

Author SHA1 Message Date
Sunny
b488389d8a TOUT MARRRRRCHE!!! 2025-12-05 10:45:49 -05:00
Lea
c928b9483d modification de la fonction partie nulle 2025-12-05 10:22:44 -05:00
Sunny
ffe4af9f93 Merge branch 'main' of https://gitea.zkd.ca/DEV_WEB/TicTacToe 2025-12-05 10:13:11 -05:00
Sunny
1d513239d2 WTF 2025-12-05 10:12:30 -05:00
Sunny
b991978b6d Idk, dude 2025-12-05 10:02:20 -05:00
Sunny
a72da69ea7 Work 2025-12-05 09:51:51 -05:00
2 changed files with 36 additions and 26 deletions

View File

@@ -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;