UPDATE MAJEUR : Intégration des mots de 4 lettres.
This commit is contained in:
2
0
2
0
@@ -1 +1 @@
|
||||
Appuyez sur une touche pour continuer...
|
||||
Appuyez sur une touche pour continuer...
|
||||
74
Mots/mot4lettres.txt
Normal file
74
Mots/mot4lettres.txt
Normal file
@@ -0,0 +1,74 @@
|
||||
abdo
|
||||
abri
|
||||
adon
|
||||
afin
|
||||
agir
|
||||
aide
|
||||
aigu
|
||||
aile
|
||||
aire
|
||||
aise
|
||||
allo
|
||||
alma
|
||||
alpe
|
||||
alte
|
||||
alto
|
||||
amer
|
||||
anal
|
||||
ange
|
||||
anti
|
||||
anus
|
||||
aria
|
||||
arme
|
||||
aube
|
||||
auge
|
||||
aura
|
||||
auto
|
||||
aval
|
||||
avec
|
||||
axer
|
||||
azur
|
||||
bave
|
||||
bide
|
||||
bien
|
||||
bise
|
||||
bite
|
||||
bleu
|
||||
blog
|
||||
bobo
|
||||
boom
|
||||
boss
|
||||
bouc
|
||||
boue
|
||||
boxe
|
||||
bras
|
||||
bref
|
||||
bric
|
||||
brin
|
||||
brou
|
||||
brun
|
||||
buse
|
||||
caca
|
||||
cage
|
||||
camp
|
||||
case
|
||||
cave
|
||||
ceci
|
||||
cent
|
||||
cerf
|
||||
chat
|
||||
chef
|
||||
cher
|
||||
chez
|
||||
chic
|
||||
ciel
|
||||
clou
|
||||
club
|
||||
cote
|
||||
coup
|
||||
cour
|
||||
cout
|
||||
crac
|
||||
cran
|
||||
cric
|
||||
cube
|
||||
@@ -162,6 +162,7 @@
|
||||
<Text Include="Alphabet\Y.txt" />
|
||||
<Text Include="Alphabet\Z.txt" />
|
||||
<Text Include="Mots\mot3lettres.txt" />
|
||||
<Text Include="Mots\mot4lettres.txt" />
|
||||
<Text Include="TaxonLogo.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
<Filter Include="Fichiers de ressources\Alphabet">
|
||||
<UniqueIdentifier>{df2ed3d4-f003-4ddf-afbb-9da73c17e1f3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers de ressources\Mots">
|
||||
<UniqueIdentifier>{e4854bf8-7fba-4be2-912e-80d765ca577e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
@@ -52,9 +55,6 @@
|
||||
<Text Include="TaxonLogo.txt">
|
||||
<Filter>Fichiers de ressources\AfficheMenu</Filter>
|
||||
</Text>
|
||||
<Text Include="Mots\mot3lettres.txt">
|
||||
<Filter>Fichiers de ressources</Filter>
|
||||
</Text>
|
||||
<Text Include="Alphabet\A.txt">
|
||||
<Filter>Fichiers de ressources\Alphabet</Filter>
|
||||
</Text>
|
||||
@@ -133,6 +133,12 @@
|
||||
<Text Include="Alphabet\Z.txt">
|
||||
<Filter>Fichiers de ressources\Alphabet</Filter>
|
||||
</Text>
|
||||
<Text Include="Mots\mot3lettres.txt">
|
||||
<Filter>Fichiers de ressources\Mots</Filter>
|
||||
</Text>
|
||||
<Text Include="Mots\mot4lettres.txt">
|
||||
<Filter>Fichiers de ressources\Mots</Filter>
|
||||
</Text>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="README.md">
|
||||
|
||||
4
main.cpp
4
main.cpp
@@ -24,9 +24,10 @@ int main() {
|
||||
|
||||
bool quitter = false; //Quitter le jeu
|
||||
int nbMot3lettre = 15; //Nombre de mot pr<70>sent dans le fichier
|
||||
int nbLettre = 3;
|
||||
int nbLettre = 4;
|
||||
string motRandom; // Mot random
|
||||
const int NOMBREMOT3LETTRE = 101;
|
||||
const int NOMBREMOT4LETTRE = 74;
|
||||
int nbEssai = 6;
|
||||
|
||||
while (quitter == false) {
|
||||
@@ -52,6 +53,7 @@ int main() {
|
||||
curseur(true);
|
||||
system("cls");
|
||||
choixNbEssai();
|
||||
choixLongeurMot();
|
||||
break;
|
||||
|
||||
case '3':
|
||||
|
||||
@@ -25,7 +25,9 @@ using namespace std::chrono_literals;
|
||||
|
||||
const int BONNE_PLACE = 1, MAUVAIS_PLACE = 2, PAS_LA = 3;
|
||||
extern const int NOMBREMOT3LETTRE = 101;
|
||||
extern const int NOMBREMOT4LETTRE = 74;
|
||||
extern int nbEssai = 6;
|
||||
extern int nbLettre = 4;
|
||||
|
||||
/*====================================
|
||||
MENU
|
||||
@@ -110,8 +112,13 @@ string goToLine(fstream& monFlux, int numeroLigne) {//g
|
||||
|
||||
void effectuerTour(int nbLettre)
|
||||
{
|
||||
|
||||
string motRandom = choisirMot("Mots/mot3lettres.txt", NOMBREMOT3LETTRE);
|
||||
string motRandom;
|
||||
if (nbLettre == 3) {
|
||||
motRandom = choisirMot("Mots/mot3lettres.txt", NOMBREMOT3LETTRE);
|
||||
}
|
||||
else if (nbLettre == 4) {
|
||||
motRandom = choisirMot("Mots/mot4lettres.txt", NOMBREMOT4LETTRE);
|
||||
}
|
||||
|
||||
cout << setw(83) << "=============================================\n";
|
||||
|
||||
@@ -157,18 +164,30 @@ void effectuerTour(int nbLettre)
|
||||
|
||||
|
||||
bool dansListe(string motPlayer) {
|
||||
|
||||
fstream monFlux;
|
||||
ouvrirFichier(monFlux, "Mots/mot3lettres.txt");
|
||||
|
||||
string mot;
|
||||
for (int i = 0; i < NOMBREMOT3LETTRE; i++) {
|
||||
getline(monFlux, mot);
|
||||
if (nbLettre == 3) {
|
||||
ouvrirFichier(monFlux, "Mots/mot3lettres.txt");
|
||||
for (int i = 0; i < NOMBREMOT3LETTRE; i++) {
|
||||
getline(monFlux, mot);
|
||||
|
||||
if (motPlayer == mot)
|
||||
{
|
||||
fermerFichier(monFlux);
|
||||
return true;
|
||||
if (motPlayer == mot)
|
||||
{
|
||||
fermerFichier(monFlux);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (nbLettre == 4) {
|
||||
ouvrirFichier(monFlux, "Mots/mot4lettres.txt");
|
||||
for (int i = 0; i < NOMBREMOT4LETTRE; i++) {
|
||||
getline(monFlux, mot);
|
||||
|
||||
if (motPlayer == mot)
|
||||
{
|
||||
fermerFichier(monFlux);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
fermerFichier(monFlux);
|
||||
@@ -254,11 +273,34 @@ void printLettre(fstream& monFlux, int positionLettre)
|
||||
/*====================================
|
||||
2 - OPTIONS
|
||||
====================================*/
|
||||
void choixNbEssai() {
|
||||
void choixNbEssai()
|
||||
{
|
||||
cout << "Veuillez choisir le nombre de tentative que vous souhaitez avoir."
|
||||
<< "\nPar defaut, le nombre de tentative est a 6."
|
||||
<< endl
|
||||
<< "Nombre de tentative : ";
|
||||
cin >> nbEssai;
|
||||
cout << "Vous avez choisi d'avoir " << nbEssai << " tentatives.";
|
||||
cout << "Vous avez choisi d'avoir " << nbEssai << " tentatives."
|
||||
<< endl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
void choixLongeurMot() {
|
||||
cout << "Veuillez choisir la longueur des mots a deviner."
|
||||
<< "\nPar defaut, la longeur est a 3 lettres."
|
||||
<< "\n***Pour le moment, uniquement les mots de 3 et de 4 lettres fonctionnent.***"
|
||||
<< endl
|
||||
<< "Longeur des mots : ";
|
||||
cin >> nbLettre;
|
||||
if (nbLettre == 3 || nbLettre == 4) {
|
||||
cout << "Vous avez choisi d'avoir " << nbLettre << " lettres dans les mots a trouver."
|
||||
<< endl
|
||||
<< endl;
|
||||
}
|
||||
else {
|
||||
nbLettre = 3;
|
||||
cout << "Choix non disponible, nous avons choisis pour vous. Les mots auront 3 lettres."
|
||||
<< endl
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
@@ -39,4 +39,5 @@ void printLettre(fstream& monFlux, int positionLettre);
|
||||
/*====================================
|
||||
2 - OPTIONS
|
||||
====================================*/
|
||||
void choixNbEssai();
|
||||
void choixNbEssai();
|
||||
void choixLongeurMot();
|
||||
Reference in New Issue
Block a user