commentaire important

This commit is contained in:
William
2025-11-28 09:50:29 -05:00
parent f754bebf05
commit 64b8ee7401
3 changed files with 18 additions and 8 deletions

View File

@@ -40,9 +40,9 @@ int main() {
delai();
curseur(true);
system("cls");
background(temp);
motRandom = choisirMot("Mots/mot3lettres.txt", nbMot3lettre);
afficherMenuJouer();
//background(temp);
effectuerTour();
break;
case '2':

View File

@@ -95,6 +95,7 @@ string choisirMot(string nomFichier, int maximum) {//Choisi un mot al
fermerFichier(monFlux);
return motRandom;
}
string goToLine(fstream& monFlux, int numeroLigne) {//g<>n<EFBFBD>re un nb al<61>atoire, et choisi une ligne associ<63> pour un mot al<61>atoire. renvoi le mot choisi
string mot;
for (int i = 0; i < numeroLigne; i++) {
@@ -103,11 +104,14 @@ string goToLine(fstream& monFlux, int numeroLigne) {//g
return mot;
}
void afficherMenuJouer()
void effectuerTour()
{
string motRandom = choisirMot("Mots/mot3lettres.txt", 15);
cout << setw(83) << "=============================================\n";
string motPlayer;
for (int nbTentative = 0; nbTentative < 6; nbTentative++)
{
do
@@ -115,11 +119,15 @@ void afficherMenuJouer()
cout << setw(65) << "Tentative #" << nbTentative + 1 << endl;
cout << setw(69) << "Saisir votre mot : ";
cin >> motPlayer;
} while (motPlayer.length() > 3);
} while (motPlayer.length() == 3);
if (dansListe(motPlayer))
{
cout << "\na continue\n";
cout << "\nto continue\n";
//NE PAS EFFACER
//if (motRandom[0] == motPlayer[0])
//else if (motRandom[0] == motPlayer[1] || motPlayer[2])
}
else
{
@@ -145,11 +153,13 @@ bool dansListe(string motPlayer)
if (motPlayer == mot)
{
fermerFichier(monFlux);
return true;
}
}
return false;
fermerFichier(monFlux);
return false;
}

View File

@@ -32,6 +32,6 @@ void backgroundDefault();
string choisirMot(string nomFichier, int maximum);
string goToLine(fstream& monFlux, int numeroLigne);
void afficherMenuJouer();
void effectuerTour();
bool dansListe(string motPlayer);
bool comparerMot(fstream& monFlux, string motPlayer, int numeroLigne);