Finalisation de la mise en commun du code
This commit is contained in:
@@ -87,6 +87,25 @@ void curseur(bool interrupteur) {
|
||||
1 - JOUER
|
||||
====================================*/
|
||||
//fonction pour choisir le mot de facon random
|
||||
void choisirMot(string nomFichier, int maximum) {
|
||||
system("cls");
|
||||
|
||||
int numeroLigne = rand() % (maximum)+1;
|
||||
|
||||
fstream monFlux;
|
||||
ouvrirFichier(monFlux, nomFichier);
|
||||
string mot = goToLine(monFlux, numeroLigne);
|
||||
fermerFichier(monFlux);
|
||||
|
||||
}
|
||||
string goToLine(fstream& monFlux, int numeroLigne) {
|
||||
string mot;
|
||||
for (int i = 0; i < numeroLigne; i++) {
|
||||
getline(monFlux, mot);
|
||||
}
|
||||
return mot;
|
||||
}
|
||||
|
||||
void afficherMenuJouer()
|
||||
{
|
||||
cout << setw(83) << "=============================================\n";
|
||||
|
||||
Reference in New Issue
Block a user