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 nbrLettreMin = 4;
int nbrLettreMax = 12; int nbrLettreMax = 12;
String s = ""; 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) { switch (level) {
case 'e': case 'e':
nbrLettreMin = 4; nbrLettreMin = 0;
nbrLettreMax = 6; nbrLettreMax = 6;
break; break;
@ -76,7 +77,7 @@ public class WordManager {
case 'd': case 'd':
nbrLettreMin = 10; nbrLettreMin = 10;
nbrLettreMax = 12; nbrLettreMax = Integer.MAX_VALUE;
break; break;
default: default:
@ -84,7 +85,7 @@ public class WordManager {
} }
int lg; int lg;
do { do {
int nbr = (int)(Math.random()*600); int nbr = (int)(Math.random()*200000);
s = word[nbr]; s = word[nbr];
lg = s.length(); lg = s.length();
} while (lg < nbrLettreMin || lg > nbrLettreMax); } while (lg < nbrLettreMin || lg > nbrLettreMax);