Enregistrement de mes dernieres modifications
This commit is contained in:
2
0
2
0
@@ -1 +1 @@
|
||||
Appuyez sur une touche pour continuer...
|
||||
Appuyez sur une touche pour continuer...
|
||||
10
main.cpp
10
main.cpp
@@ -42,8 +42,14 @@ int main() {
|
||||
curseur(true);
|
||||
system("cls");
|
||||
|
||||
|
||||
effectuerTour();
|
||||
if (effectuerTour()) {
|
||||
// Victoire
|
||||
cout << "VICTOIRE !!!";
|
||||
}
|
||||
else {
|
||||
// D<>faite
|
||||
cout << "DEFAITE !!!";
|
||||
}
|
||||
break;
|
||||
|
||||
case '2':
|
||||
|
||||
@@ -123,9 +123,10 @@ string goToLine(fstream& monFlux, int numeroLigne) {//g
|
||||
return mot;
|
||||
}
|
||||
|
||||
void effectuerTour()
|
||||
bool effectuerTour()
|
||||
{
|
||||
string motRandom;
|
||||
int nbBonneLettre = 0;
|
||||
if (nbLettre == 3) {
|
||||
motRandom = choisirMot("Mots/mot3lettres.txt");
|
||||
}
|
||||
@@ -155,6 +156,7 @@ void effectuerTour()
|
||||
if (lettreDansMot(motRandom, motPlayer, nbLettre, i) == BONNE_PLACE) {
|
||||
lettrePlayer = motPlayer[i];
|
||||
afficherMotPlayer(lettrePlayer, BONNE_PLACE);
|
||||
nbBonneLettre++;
|
||||
}
|
||||
else if (lettreDansMot(motRandom, motPlayer, nbLettre, i) == MAUVAIS_PLACE) {
|
||||
lettrePlayer = motPlayer[i];
|
||||
@@ -173,6 +175,14 @@ void effectuerTour()
|
||||
nbTentative--;
|
||||
}
|
||||
}
|
||||
if (nbBonneLettre == nbLettre)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ int nombreLigneFichier(fstream& monFlux);
|
||||
string choisirMot(string nomFichier);
|
||||
string goToLine(fstream& monFlux, int numeroLigne);
|
||||
|
||||
void effectuerTour();
|
||||
bool effectuerTour();
|
||||
bool dansListe(string motPlayer);
|
||||
bool comparerMot(fstream& monFlux, string motPlayer, int numeroLigne);
|
||||
int lettreDansMot(string motRandom, string motPlayer, int nbLettre, int i);
|
||||
|
||||
Reference in New Issue
Block a user