From 5597f5248d02148c9dbefbde8217a7a206c112f5 Mon Sep 17 00:00:00 2001 From: Lea Date: Wed, 26 Nov 2025 11:22:17 -0500 Subject: [PATCH] =?UTF-8?q?DERNIER=20COMMIT=20DE=20LA=20JOURN=C3=89E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TicTacToe/0 | 2 +- TicTacToe/fonctions.cpp | 35 ++++++++++++-------------------- TicTacToe/main.cpp | 5 ----- TicTacToe/themes/themeDefaut.txt | 1 + 4 files changed, 15 insertions(+), 28 deletions(-) diff --git a/TicTacToe/0 b/TicTacToe/0 index d7619da..4588032 100644 --- a/TicTacToe/0 +++ b/TicTacToe/0 @@ -1 +1 @@ -Appuyez sur une touche pour continuer... \ No newline at end of file +Appuyez sur une touche pour continuer... diff --git a/TicTacToe/fonctions.cpp b/TicTacToe/fonctions.cpp index a0ac649..c45a346 100644 --- a/TicTacToe/fonctions.cpp +++ b/TicTacToe/fonctions.cpp @@ -49,11 +49,11 @@ void afficherMenu(char& choix) { fermerFichier(monFlux); // Menu - cout << endl << "MENU" << endl << "----------------------------------" << endl + cout << endl << "MENU" << endl + << "----------------------------------" << endl << "A) 1 joueur" << endl << "B) 2 joueurs" << endl - << "C) Montrer l'historique des scores" << endl - << "D) Changer le style du jeu" << endl + << "C) Changer le style du jeu" << endl << "Q) Quitter" << endl << endl << "Quel est votre choix? "; choix = toupper(_getche()); @@ -86,13 +86,6 @@ void afficherImageMenu(std::fstream& monFlux) { } //Général (plusieurs options) -void initTab(string grid[][LARGTIC]) { - for (int i = 0; i < LARGTIC; i++) { - for (int j = 0; j < LARGTIC; j++) { - grid[i][j] = " "; - } - } -} void afficherImageTableau(std::string grid[][LARGTIC], std::string style) { SetConsoleOutputCP(CP_UTF8); @@ -106,7 +99,7 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) { ouvrirFichier(monFlux, style); if (monFlux) { while (!monFlux.eof()) { - monFlux >> emoteUp >> emoteDown >> iconJ1 >> iconJ2; + monFlux >> emoteUp >> emoteDown >> ICONJ1 >> ICONJ2; } monFlux.close(); cout << endl; @@ -117,6 +110,9 @@ 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 << " "; for (int i = 0; i < LARGTIC; i++) { @@ -133,27 +129,27 @@ void afficherImageTableau(std::string grid[][LARGTIC], std::string style) { cout << endl << " "; for (int i = 0; i < LARGTIC; i++) { - cout << " |"; + cout << "|"; for (int j = 0; j < 3; j++) { cout << " "; } } - cout << " |" << endl << " " << k + 1 << " "; + cout << "|" << endl << " " << k + 1 << " "; for (int i = 0; i < LARGTIC; i++) { - cout << " |" << " " << grid[k][i] << " "; + cout << "|" << " " << grid[k][i] << " "; } cout << " |" << endl << " "; for (int i = 0; i < LARGTIC; i++) { - cout << " |"; + cout << "|"; for (int j = 0; j < 3; j++) { cout << " "; } } - cout << " |" << endl << " "; + cout << "|" << endl << " "; } @@ -346,14 +342,9 @@ void jeuDeuxJoueurs(string grid[][LARGTIC]) { afficherFinMatch(grid, gagnant, nbJoueurs); } -//Historique -void historiqueDesScores() { - -} - //Changer le thème void changerLeTheme() { - string grid[LARGTIC][LARGTIC] = {ICONJ1, ICONJ2}; + string grid[LARGTIC][LARGTIC]; system("cls"); do { cout << endl << "Changer le theme du jeu Tic Tac Toe" << endl diff --git a/TicTacToe/main.cpp b/TicTacToe/main.cpp index a4da395..e1cc9cb 100644 --- a/TicTacToe/main.cpp +++ b/TicTacToe/main.cpp @@ -20,7 +20,6 @@ int main() { string grid[LARGTIC][LARGTIC]; do { - initTab(grid); afficherMenu(choix); switch (choix) { @@ -35,10 +34,6 @@ int main() { break; case 'C': - historiqueDesScores(); - break; - - case 'D': changerLeTheme(); break; diff --git a/TicTacToe/themes/themeDefaut.txt b/TicTacToe/themes/themeDefaut.txt index 44305f9..2c67882 100644 --- a/TicTacToe/themes/themeDefaut.txt +++ b/TicTacToe/themes/themeDefaut.txt @@ -2,3 +2,4 @@ 🔹 âœ–ï¸ â­• + \ No newline at end of file