JEU FONCTIONNEL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This commit is contained in:
@@ -142,7 +142,6 @@ bool effectuerTour()
|
||||
{
|
||||
string lettrePlayer;
|
||||
do {
|
||||
cout << "Le mot est " << motRandom << endl; // TODO: RETIRER SA
|
||||
cout << setw(69) << "Tentative des mots de " << nbLettre << " #" << nbTentative + 1 << endl;
|
||||
cout << setw(69) << "Saisir votre mot : ";
|
||||
cin >> motPlayer; //TODO: mettre tolower string (boucle)
|
||||
@@ -172,6 +171,7 @@ bool effectuerTour()
|
||||
|
||||
if (nbBonneLettre == nbLettre)
|
||||
{
|
||||
afficherVictoire(motRandom);
|
||||
return true;
|
||||
}
|
||||
cout << endl;
|
||||
@@ -182,6 +182,7 @@ bool effectuerTour()
|
||||
nbTentative--;
|
||||
}
|
||||
}
|
||||
afficherDefaite(motRandom);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -287,6 +288,22 @@ void printLettre(fstream& monFlux, int positionLettre)
|
||||
SetConsoleTextAttribute(hconsole, 15);
|
||||
}
|
||||
|
||||
// Affichage victoire et d<>faite
|
||||
void afficherVictoire(string motRandom) {
|
||||
system("cls");
|
||||
cout << "Felicitations, vous avez gagnez ! Le mot etais bien \"" << motRandom << "\" :D";
|
||||
system("PAUSE>NUL");
|
||||
}
|
||||
|
||||
void afficherDefaite(string motRandom) {
|
||||
system("cls");
|
||||
cout << "Dommage ! Meilleur chance la prochaine fois..."
|
||||
<< endl
|
||||
<< "Pour votre information, le mot a deviner etais \"" << motRandom << "\".";
|
||||
system("PAUSE>NUL");
|
||||
}
|
||||
|
||||
|
||||
/*====================================
|
||||
2 - OPTIONS
|
||||
====================================*/
|
||||
|
||||
Reference in New Issue
Block a user