JEU FONCTIONNEL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This commit is contained in:
18
main.cpp
18
main.cpp
@@ -6,6 +6,15 @@ DATE : 17 novembre 2025
|
||||
BUT : Rassemble les appels de fonction de Taxon
|
||||
====================================*/
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
SCOREBOARD pour fichier en <20>criture
|
||||
|
||||
|
||||
*/
|
||||
|
||||
//Librairies
|
||||
#include <iostream>
|
||||
#include <conio.h>
|
||||
@@ -44,14 +53,7 @@ int main() {
|
||||
curseur(true);
|
||||
system("cls");
|
||||
|
||||
if (effectuerTour()) {
|
||||
// Victoire
|
||||
cout << "VICTOIRE !!!";
|
||||
}
|
||||
else {
|
||||
// D<>faite
|
||||
cout << "DEFAITE !!!";
|
||||
}
|
||||
effectuerTour();
|
||||
break;
|
||||
|
||||
case '2':
|
||||
|
||||
@@ -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
|
||||
====================================*/
|
||||
|
||||
@@ -38,6 +38,10 @@ int lettreDansMot(string motRandom, string motPlayer, int nbLettre, int i);
|
||||
void afficherMotPlayer(string lettrePlayer, int positionLettre);
|
||||
void printLettre(fstream& monFlux, int positionLettre);
|
||||
|
||||
// Messages victoire et d<>faite
|
||||
void afficherVictoire(string motRandom);
|
||||
void afficherDefaite(string motRandom);
|
||||
|
||||
/*====================================
|
||||
2 - OPTIONS
|
||||
====================================*/
|
||||
|
||||
Reference in New Issue
Block a user