From 150e5334027846b816995bcf6d268e2c4001a406 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 5 Dec 2025 11:35:42 -0500 Subject: [PATCH] Update: liste de mots --- 0 | 2 +- Mots/mot3lettres.txt | 5 +++-- main.cpp | 1 + mesFonctions.cpp | 5 +++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/0 b/0 index ba64bff..4588032 100644 --- a/0 +++ b/0 @@ -1 +1 @@ -Press any key to continue . . . \ No newline at end of file +Appuyez sur une touche pour continuer... diff --git a/Mots/mot3lettres.txt b/Mots/mot3lettres.txt index 878c9f6..03e9e1e 100644 --- a/Mots/mot3lettres.txt +++ b/Mots/mot3lettres.txt @@ -13,7 +13,7 @@ toi moi eux mat -les +les met mer dos @@ -48,4 +48,5 @@ ion fin vie tri -ris \ No newline at end of file +ris +lis \ No newline at end of file diff --git a/main.cpp b/main.cpp index 6e961b5..eadee5b 100644 --- a/main.cpp +++ b/main.cpp @@ -27,6 +27,7 @@ int main() { int temp = 0; //TODO: Variable temporaire int nbLettre = 3; string motRandom; // Mot random + const int NOMBREMOT3LETTRE = 51; while (quitter == false) { curseur(false); diff --git a/mesFonctions.cpp b/mesFonctions.cpp index 87c4768..69d6b15 100644 --- a/mesFonctions.cpp +++ b/mesFonctions.cpp @@ -24,6 +24,7 @@ using namespace std::chrono_literals; #include //Sources : https://www.tutorialspoint.com/cpp_standard_library/limits.htm et https://stackoverflow.com/questions/2158943/split-string-into-array-of-chars const int BONNE_PLACE = 1, MAUVAIS_PLACE = 2, PAS_LA = 3; +extern const int NOMBREMOT3LETTRE = 51; /*==================================== MENU @@ -111,7 +112,7 @@ void effectuerTour(int nbLettre) string nomFichier; HANDLE hconsole = GetStdHandle(STD_OUTPUT_HANDLE);//pour la couleur - string motRandom = choisirMot("Mots/mot3lettres.txt", 15); + string motRandom = choisirMot("Mots/mot3lettres.txt", NOMBREMOT3LETTRE); cout << setw(83) << "=============================================\n"; @@ -179,7 +180,7 @@ bool dansListe(string motPlayer) { ouvrirFichier(monFlux, "Mots/mot3lettres.txt"); string mot; - for (int i = 0; i < 15; i++) { //TODO changer le chiffre 15 par le numéro de ligne dans le ficher + for (int i = 0; i < NOMBREMOT3LETTRE; i++) { getline(monFlux, mot); if (motPlayer == mot)