Mise en commun du code.

This commit is contained in:
2025-11-28 08:34:59 -05:00
parent 9f994bb44d
commit 714a65903e
3 changed files with 17 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ int main() {
system("cls");
background(temp);
choisirMot("Mots/mot3lettres.txt", nbMot3lettre);
afficherMenuJouer();
break;
case '2':

View File

@@ -94,7 +94,6 @@ void choisirMot(string nomFichier, int maximum) {
ouvrirFichier(monFlux, nomFichier);
string mot = goToLine(monFlux, numeroLigne);
fermerFichier(monFlux);
cout << numeroLigne << " " << mot;
}
string goToLine(fstream& monFlux, int numeroLigne) {
string mot;
@@ -104,6 +103,19 @@ string goToLine(fstream& monFlux, int numeroLigne) {
return mot;
}
void afficherMenuJouer() {
cout << setw(83) << "=============================================\n";
string motPlayer;
do
{
cout << setw(69) << "Saisir votre mot : ";
cin >> motPlayer;
} while (motPlayer.length() > 3);
cout << setw(66) << "Votre mot est : " << motPlayer;
}
/*====================================
2 - OPTIONS
====================================*/

View File

@@ -30,4 +30,6 @@ void backgroundDefault();
// Mot
void choisirMot(string nomFichier, int maximum);
string goToLine(fstream& monFlux, int numeroLigne);
string goToLine(fstream& monFlux, int numeroLigne);
void afficherMenuJouer();