diff --git a/mesFonctions.cpp b/mesFonctions.cpp index 915c108..cab89d2 100644 --- a/mesFonctions.cpp +++ b/mesFonctions.cpp @@ -116,6 +116,27 @@ void afficherMenuJouer() { cout << setw(66) << "Votre mot est : " << motPlayer; } +bool dansListe(string motPlayer) +{ + fstream monFlux; + ouvrirFichier(monFlux, "Mots/mot3lettres.txt"); + + comparerMot(monFlux, motPlayer, 15); + +} +bool comparerMot(fstream& monFlux, string motPlayer, int numeroLigne) +{ + string mot; + for (int i = 0; i < numeroLigne; i++) { + getline(monFlux, mot); + if (motPlayer == mot) + { + return true; + } + } + return false; +} + /*==================================== 2 - OPTIONS ====================================*/