So I'm trying to make a sports game schedule generator. This randomly selects from an array that consists of field names. How do I make it so that It won't select the same field twice?
Random rand = new Random();
int index, loc;
index = rand.nextInt();
loc = rand.nextInt(y);
System.out.print(fields[loc]);
Aucun commentaire:
Enregistrer un commentaire