This commit is contained in:
Rémi Heredero 2021-11-20 21:28:40 +01:00
parent 9e56ee475a
commit a7f4c1ec9e
2 changed files with 5 additions and 4 deletions

Binary file not shown.

View File

@ -61,11 +61,12 @@ public class WordManager {
int nbrLettreMin = 4;
int nbrLettreMax = 12;
String s = "";
String[] word = loadList("C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S1fb/informatic/labo/vscode/Labo/src/lab6/french_common_words.csv");
//String[] word = loadList("C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S1fb/informatic/labo/vscode/Labo/src/lab6/french_common_words.csv");
String[] word = loadList("C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S1fb/informatic/labo/vscode/Labo/src/lab6/french_dictionary.txt");
switch (level) {
case 'e':
nbrLettreMin = 4;
nbrLettreMin = 0;
nbrLettreMax = 6;
break;
@ -76,7 +77,7 @@ public class WordManager {
case 'd':
nbrLettreMin = 10;
nbrLettreMax = 12;
nbrLettreMax = Integer.MAX_VALUE;
break;
default:
@ -84,7 +85,7 @@ public class WordManager {
}
int lg;
do {
int nbr = (int)(Math.random()*600);
int nbr = (int)(Math.random()*200000);
s = word[nbr];
lg = s.length();
} while (lg < nbrLettreMin || lg > nbrLettreMax);