Mise en commun du code.
This commit is contained in:
1
main.cpp
1
main.cpp
@@ -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':
|
||||||
|
|||||||
@@ -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
|
||||||
====================================*/
|
====================================*/
|
||||||
|
|||||||
@@ -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();
|
||||||
Reference in New Issue
Block a user