Hi guy how do I randomize these numbers inside this arrays?
private double amounts[] = { 0, 0.01, 1000000, 25, 250000, 75, 50, 1000,
200, 100, 400000, 750, 5000, 750000, 500, 100000, 300, 75000, 800,
20, 300000, 10, 50, 750, 25, 5, 1 };
I want to randomize them without reptition so that I could insert them into this line of code so that each briefcase will hold a different value.
public void casesSetup() {
for (int i = 0; i < briefcase.length; i++) {
if (i == 0) {
} else {
briefcase[i] = new Briefcase();
double value = amounts[i];
briefcase[i].setAmount(value);
briefcase[i].setFace(i);
}
}
}
Thanks in advance :D