diff --git a/TicTacToe/fonctions.cpp b/TicTacToe/fonctions.cpp index 932f065..48b80c7 100644 --- a/TicTacToe/fonctions.cpp +++ b/TicTacToe/fonctions.cpp @@ -275,15 +275,6 @@ void afficherFinMatch(string grid[][LARGTIC], int gagnant, int nbJoueurs) { cout << "\n\nPartie nulle!"; } } - else { - if (gagnant == 3) { - cout << "\n\nPartie nulle!"; - } - else { - cout << "\n\nLe joueur " << gagnant - << " a gagne la partie!"; - } - } } int partieNulle(string grid[][LARGTIC], int compteur) { @@ -292,6 +283,10 @@ int partieNulle(string grid[][LARGTIC], int compteur) { gagnant = 3; return gagnant; } + else { + gagnant = 1; + return gagnant; + } } // Joueur @@ -346,7 +341,7 @@ void tourJoueur(string grid[][LARGTIC], int joueur) { //1 joueur void jeuUnJoueur(string grid[][LARGTIC]) { bool fin; - int gagnant; + int gagnant = 1; int nbJoueurs = 1; int compteur = 0; @@ -386,7 +381,7 @@ void tourOrdi(string grid[][LARGTIC]) { //2 joueurs void jeuDeuxJoueurs(string grid[][LARGTIC]) { bool fin; - int gagnant; + int gagnant = 1; int nbJoueurs = 2; int compteur = 0;