From a650f6bc343ddd0e8fd079db23030bc5e2bac90f Mon Sep 17 00:00:00 2001 From: Lea Date: Wed, 26 Nov 2025 10:38:05 -0500 Subject: [PATCH] =?UTF-8?q?r=C3=A9solution=20du=20probl=C3=A8me=20avec=20l?= =?UTF-8?q?'affichage=20des=20th=C3=A8mes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TicTacToe/fonctions.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/TicTacToe/fonctions.cpp b/TicTacToe/fonctions.cpp index aef3077..363dd11 100644 --- a/TicTacToe/fonctions.cpp +++ b/TicTacToe/fonctions.cpp @@ -17,9 +17,7 @@ using namespace std; extern const int LARGTIC; string ICONJ1 = "X"; string ICONJ2 = "O"; - string ICONJ1 = "X"; - string ICONJ2 = "O"; - string style; + string style = "themes/themeSea.txt"; int codeConsole = 0; fstream monFlux; @@ -104,6 +102,7 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) { iconJ2; // Faire une fonction pour retenir le thème sélectionné par le joueur!!!! + ouvrirFichier(monFlux, style); if (monFlux) { while (!monFlux.eof()) { @@ -339,20 +338,19 @@ void historiqueDesScores() { void changerLeTheme() { string grid[LARGTIC][LARGTIC] = {ICONJ1, ICONJ2}; system("cls"); - cout << endl << "Changer le theme du jeu Tic Tac Toe" << endl - << "Options des styles: " << "\nA) Ocean" - << "\nB) Fantaisie" << "\nC) Espace" - << "\nD) Animaux" << "\nQ) Revenir en arriere" - << "\nChoisir une option: "; - choix = toupper(_getche()); - cout << endl; - do { + cout << endl << "Changer le theme du jeu Tic Tac Toe" << endl + << "Options des styles: " << "\nA) Ocean" + << "\nB) Fantaisie" << "\nC) Espace" + << "\nD) Animaux" << "\nQ) Revenir en arriere" + << "\nChoisir une option: "; + choix = toupper(_getche()); + cout << endl; + switch (choix) { case 'A': style = "themes/themeSea.txt"; afficherImageTableau(grid, style); - system("PAUSE"); break; case 'B': @@ -375,6 +373,7 @@ void changerLeTheme() { default: cout << "\nChoisir une option valide. \n"; + break; } } while (choix != 'Q'); } \ No newline at end of file