diff --git a/TicTacToe/fonctions.cpp b/TicTacToe/fonctions.cpp index e9d19a1..dda798d 100644 --- a/TicTacToe/fonctions.cpp +++ b/TicTacToe/fonctions.cpp @@ -15,9 +15,9 @@ BUT : Fichier de fonctions Tic Tac Toe using namespace std; extern const int LARGTIC; -string ICONJ1 = "X"; -string ICONJ2 = "O"; -string style; + string ICONJ1 = "X"; + string ICONJ2 = "O"; + string style = "themes/themeSea.txt"; int codeConsole = 0; fstream monFlux; @@ -102,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()) { @@ -337,19 +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) { + switch (choix) { case 'A': style = "themes/themeSea.txt"; afficherImageTableau(grid, style); - system("PAUSE"); break; case 'B': @@ -373,5 +374,6 @@ void changerLeTheme() { default: cout << "\nChoisir une option valide. \n"; break; - } + } + } while (choix != 'Q'); } \ No newline at end of file