forked from menault/TD3_DEV51_Qualite_Algo
Recherche de mot random
This commit is contained in:
19
recherche_mot.java
Normal file
19
recherche_mot.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class recherche_mot {
|
||||||
|
//Liste des mots
|
||||||
|
private static String[] WORDS = {
|
||||||
|
"Singe", "Google", "Frapper", "Haine", "Dio", "Java",
|
||||||
|
"Felix Vimalaratnam", "Lebreton", "Argent", "Pauvre", "Grocaillou"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
//Permet de random
|
||||||
|
Random random = new Random();
|
||||||
|
//Prends le mot aléatoirement
|
||||||
|
String motrandom = WORDS[random.nextInt(WORDS.length)];
|
||||||
|
// Affiche l'mot
|
||||||
|
System.out.println("Mot qu'on prend d'facon random : " + motrandom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user