JEU FONCTIONNEL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

This commit is contained in:
2025-12-06 00:53:36 -05:00
parent f6d1303095
commit 95f56b5509
3 changed files with 32 additions and 9 deletions

View File

@@ -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':

View File

@@ -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
====================================*/

View File

@@ -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
====================================*/