forked from menault/TD3_DEV51_Qualite_Algo
Petit dictionnaire
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* La classe <code>Partie</code>
|
||||
*
|
||||
* @version 0.1
|
||||
* @version 0.2
|
||||
* @author Aurélien
|
||||
* Date : 08-10-25
|
||||
* Licence :
|
||||
@@ -81,10 +82,15 @@ public class Partie {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Génère un mot à partir d'un grand dictionnaire (enfin en principe).
|
||||
*
|
||||
* @return le mot généré.
|
||||
*/
|
||||
private char[] generateSecretWord() {
|
||||
char[] word = {'D','A','M','I','E','N'};
|
||||
//À implémenter plus tard
|
||||
Random random = new Random();
|
||||
byte grain = (byte) random.nextInt(Mots.dictionarysize);
|
||||
char[] word = Mots.dictionary[grain].toUpperCase().toCharArray();
|
||||
return word ;
|
||||
}
|
||||
|
||||
@@ -105,7 +111,7 @@ public class Partie {
|
||||
|
||||
//Tests
|
||||
public static void main(String[] args){
|
||||
char[] test = {'E','O','M','I','E','D','A','Z','N'};
|
||||
char[] test = {'E','O','M','I','E','D','A','Z','N','L','C','R','P','H','T','S'};
|
||||
byte size = (byte) test.length ;
|
||||
boolean status ;
|
||||
|
||||
@@ -124,5 +130,6 @@ public class Partie {
|
||||
System.out.println(""); //Lisibilité
|
||||
//System.out.println("Lettres : " + game.entriesletters);
|
||||
}
|
||||
System.out.println("Essais restants : " + game.getRemainingTry());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user