master
This commit is contained in:
parent
9e56ee475a
commit
a7f4c1ec9e
Binary file not shown.
@ -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);
|
||||||
|
Reference in New Issue
Block a user