From fcd05842edbdcc56e4ce0b700162ecc0ee2fc374 Mon Sep 17 00:00:00 2001 From: Sunny Date: Wed, 26 Nov 2025 20:02:38 -0500 Subject: [PATCH] What --- TicTacToe/fonctions.cpp | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/TicTacToe/fonctions.cpp b/TicTacToe/fonctions.cpp index 75b92e7..880205f 100644 --- a/TicTacToe/fonctions.cpp +++ b/TicTacToe/fonctions.cpp @@ -90,15 +90,15 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) { SetConsoleOutputCP(CP_UTF8); string emoteUp, emoteDown, - emoteJ1, - emoteJ2; + iconJ1, + iconJ2; // Faire une fonction pour retenir le thème sélectionné par le joueur!!!! ouvrirFichier(monFlux, style); if (monFlux) { while (!monFlux.eof()) { - monFlux >> emoteUp >> emoteDown >> emoteJ1 >> emoteJ2; + monFlux >> emoteUp >> emoteDown >> ICONJ1 >> ICONJ2; } monFlux.close(); cout << endl; @@ -109,9 +109,10 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) { } fermerFichier(monFlux); + grid[0][0] = ICONJ1; + grid[0][1] = ICONJ2; + // Lignes de code pour faire afficher le Tic Tac Toe une fois que les symboles ont été ajoutés - cout << "Joueur 1: " << emoteJ1 << " Joueur 2: " << emoteJ2 << endl << endl; - cout << " "; for (int i = 0; i < LARGTIC; i++) { cout << " " << i + 1 << " "; @@ -131,32 +132,21 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) { for (int j = 0; j < 3; j++) { cout << " "; } - cout << " "; } cout << "|" << endl << " " << k + 1 << " "; for (int i = 0; i < LARGTIC; i++) { - cout << "|" << " " ; - if (grid[k][i] == "X") { - cout << emoteJ1; - } - else if (grid[k][i] == "O") { - cout << emoteJ2; - } - else { - cout << " "; - } - cout << " "; + cout << "|" << " " << grid[k][i] << " "; + } - cout << "|" << endl << " "; + cout << " |" << endl << " "; for (int i = 0; i < LARGTIC; i++) { cout << "|"; for (int j = 0; j < 3; j++) { cout << " "; } - cout << " "; } cout << "|" << endl << " "; @@ -206,9 +196,6 @@ void tourJoueur(string grid[][LARGTIC], int joueur) { cin >> verticale; cout << "\nEntrez une coordonnee horizontale : "; cin >> horizontale; - - verticale--; - horizontale--; } if (joueur == 1) { @@ -356,7 +343,7 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) { } //Changer le thème -void changerLeTheme(bool &theme) { +void changerLeTheme() { string grid[LARGTIC][LARGTIC]; system("cls"); do { @@ -368,9 +355,6 @@ void changerLeTheme(bool &theme) { choix = toupper(_getche()); cout << endl; - if (choix >= 'A' && choix <= 'D') { - theme = true; - } switch (choix) { case 'A': style = "themes/themeSea.txt";