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"); system("cls");
background(temp); background(temp);
choisirMot("Mots/mot3lettres.txt", nbMot3lettre); choisirMot("Mots/mot3lettres.txt", nbMot3lettre);
afficherMenuJouer();
break; break;
case '2': case '2':

View File

@@ -94,7 +94,6 @@ void choisirMot(string nomFichier, int maximum) {
ouvrirFichier(monFlux, nomFichier); ouvrirFichier(monFlux, nomFichier);
string mot = goToLine(monFlux, numeroLigne); string mot = goToLine(monFlux, numeroLigne);
fermerFichier(monFlux); fermerFichier(monFlux);
cout << numeroLigne << " " << mot;
} }
string goToLine(fstream& monFlux, int numeroLigne) { string goToLine(fstream& monFlux, int numeroLigne) {
string mot; string mot;
@@ -104,6 +103,19 @@ string goToLine(fstream& monFlux, int numeroLigne) {
return mot; 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 2 - OPTIONS
====================================*/ ====================================*/

View File

@@ -31,3 +31,5 @@ void backgroundDefault();
// Mot // Mot
void choisirMot(string nomFichier, int maximum); void choisirMot(string nomFichier, int maximum);
string goToLine(fstream& monFlux, int numeroLigne); string goToLine(fstream& monFlux, int numeroLigne);
void afficherMenuJouer();