Ajout de 2 fonction pour jouer.
This commit is contained in:
@@ -116,6 +116,27 @@ void afficherMenuJouer() {
|
|||||||
cout << setw(66) << "Votre mot est : " << motPlayer;
|
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
|
2 - OPTIONS
|
||||||
====================================*/
|
====================================*/
|
||||||
|
|||||||
Reference in New Issue
Block a user