From b488389d8a296e50d7c7dd95e6e3a81eeaed04af Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 5 Dec 2025 10:45:49 -0500 Subject: [PATCH] TOUT MARRRRRCHE!!! --- TicTacToe/fonctions.cpp | 9 +++------ TicTacToe/main.cpp | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/TicTacToe/fonctions.cpp b/TicTacToe/fonctions.cpp index 2ff3f7a..52d9f9d 100644 --- a/TicTacToe/fonctions.cpp +++ b/TicTacToe/fonctions.cpp @@ -291,15 +291,14 @@ void afficherFinMatch(string grid[][LARGTIC], int gagnant, int nbJoueurs) { int partieNulle(string grid[][LARGTIC], int compteur) { int max = LARGTIC * LARGTIC; + int temp = gagnant; if (compteur == max) { gagnant = 3; - return gagnant; } - else { - gagnant = 1; - return gagnant; + gagnant = temp; } + return gagnant; } // Joueur @@ -354,7 +353,6 @@ void tourJoueur(string grid[][LARGTIC], int joueur) { //1 joueur void jeuUnJoueur(string grid[][LARGTIC]) { bool fin; - int gagnant = 1; int nbJoueurs = 1; int compteur = 0; @@ -394,7 +392,6 @@ void tourOrdi(string grid[][LARGTIC]) { //2 joueurs void jeuDeuxJoueurs(string grid[][LARGTIC]) { bool fin; - int gagnant = 1; int nbJoueurs = 2; int compteur = 0; diff --git a/TicTacToe/main.cpp b/TicTacToe/main.cpp index 7afcc1d..5eef291 100644 --- a/TicTacToe/main.cpp +++ b/TicTacToe/main.cpp @@ -21,23 +21,23 @@ int main() { afficherMenu(choix); switch (choix) { - case 'A': - system("cls"); - jeuUnJoueur(grid); - break; + case 'A': + system("cls"); + jeuUnJoueur(grid); + break; - case 'B': - system("cls"); - jeuDeuxJoueurs(grid); - break; + case 'B': + system("cls"); + jeuDeuxJoueurs(grid); + break; - case 'C': - changerLeTheme(); - break; + case 'C': + changerLeTheme(); + break; - case 'Q': - cout << "\nAu revoir!"; - break; + case 'Q': + cout << "\nAu revoir!"; + break; default: cout << endl << "Saisissez un choix valide." << endl;