Skip to content
Snippets Groups Projects
Commit ac77e5a2 authored by Ulysse Durand's avatar Ulysse Durand
Browse files

On apprend a utiliser c++

parent 76d299ef
No related branches found
No related tags found
No related merge requests found
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
#include <iostream> #include <iostream>
#include <filesystem> #include <filesystem>
#include "fullligneexception.h" #include "fullligneexception.h"
#include <QString>
using namespace std; using namespace std;
namespace fs = std::filesystem; namespace fs = std::filesystem;
#include "nowordexception.h" #include "nowordexception.h"
#include "brain.h" #include "brain.h"
Brain::Brain(string dicodir) : dicodir(dicodir) { Brain::Brain(string dicodir) : dicodir(dicodir), nbEssais(0) {
vector<string> files = getTxtFiles(); vector<string> files = getTxtFiles();
// TODO // TODO
// Initialise le menu déroulant avec files // Initialise le menu déroulant avec files
......
...@@ -46,7 +46,7 @@ void Jeu::initGame() { ...@@ -46,7 +46,7 @@ void Jeu::initGame() {
void Jeu::startGame() { void Jeu::startGame() {
brain->setFichierDico("words_alpha.txt"); brain->setFichierDico("words_alpha.txt");
brain->setNombreEssais(6); brain->setNombreEssais(8);
brain->setTailleMots(5); brain->setTailleMots(5);
brain->initGame(); brain->initGame();
......
...@@ -16,7 +16,7 @@ void Ligne::initLigne() { ...@@ -16,7 +16,7 @@ void Ligne::initLigne() {
bool Ligne::isGameCleared() { bool Ligne::isGameCleared() {
int nbjustes = 0; int nbjustes = 0;
cout << bonmot << endl; cout << bonmot.length() <<endl;
show(); show();
for (int i = 0; i < bonmot.length(); i++) { for (int i = 0; i < bonmot.length(); i++) {
char bonnelettre = toupper(bonmot[i]); // Convert to uppercase char bonnelettre = toupper(bonmot[i]); // Convert to uppercase
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment