From 6cc93a7e01ce09c6d44f5098f962ff225aada49d Mon Sep 17 00:00:00 2001 From: William Date: Fri, 28 Nov 2025 09:04:23 -0500 Subject: [PATCH] Ajout de 2 fonction pour jouer. --- mesFonctions.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 ====================================*/