Hello! I would like to ask once again for help.
I'm programming a Deal or No Deal game in Java as an assignment.
Everything works perfectly well except for this part:
I noticed that whenever I run the game, there is a particular briefcase that doesn't contain any value in it which results to the failure of the whole program. The briefcase without a value changes everytime I reset the game. I hope that someone can enlighten me what's the problem with the code I posted above. Thank you very much!
public void jumble()
{
int y = 0;
ArrayList<Double> prizesOrdered = new ArrayList();
for (double x : this.originalPrize) {
prizesOrdered.add(Double.valueOf(x));
}
Collections.shuffle(prizesOrdered);
for (Iterator iterator = prizesOrdered.iterator(); iterator.hasNext();)
{
double x = ((Double)iterator.next()).doubleValue();
this.prizes[y] = x;
y++;
}
}
