Finalisation de la mise en commun du code

This commit is contained in:
William
2025-11-28 09:11:28 -05:00
parent d9cf833e0e
commit 70b03865db

View File

@@ -87,6 +87,25 @@ void curseur(bool interrupteur) {
1 - JOUER 1 - JOUER
====================================*/ ====================================*/
//fonction pour choisir le mot de facon random //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() void afficherMenuJouer()
{ {
cout << setw(83) << "=============================================\n"; cout << setw(83) << "=============================================\n";