Recherche de mot random

This commit is contained in:
2025-10-08 09:53:16 +02:00
parent d074170b0f
commit 81b821484f

19
recherche_mot.java Normal file
View 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);
}
}