diff --git a/main.cpp b/main.cpp index eafd83c..78ecd67 100644 --- a/main.cpp +++ b/main.cpp @@ -41,6 +41,7 @@ int main() { system("cls"); background(temp); choisirMot("Mots/mot3lettres.txt", nbMot3lettre); + afficherMenuJouer(); break; case '2': diff --git a/mesFonctions.cpp b/mesFonctions.cpp index 64be1c8..915c108 100644 --- a/mesFonctions.cpp +++ b/mesFonctions.cpp @@ -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 ====================================*/ diff --git a/mesFonctions.h b/mesFonctions.h index 428e6fb..a20d0dd 100644 --- a/mesFonctions.h +++ b/mesFonctions.h @@ -30,4 +30,6 @@ void backgroundDefault(); // Mot void choisirMot(string nomFichier, int maximum); -string goToLine(fstream& monFlux, int numeroLigne); \ No newline at end of file +string goToLine(fstream& monFlux, int numeroLigne); + +void afficherMenuJouer(); \ No newline at end of file