Hi All
Having a problem with the Lotto exercise. I can generate the 6 numbers and using while loops I can avoid duplication but the more variables I generate, the more while loops I have to write for each previous variable so for the last variable:
int f = r.nextInt(46) +1;
I have 5 while loops, each ensuring f does not equal any previous variable (a, b, c, d or e).
Is there a faster way to use a while loop to avoid duplication? I tried the Or operator || but Putty and iTerm won't read this.
Thanks
Mike

Still it would be to get an answer to that question as well! Plus im having the same issue in Putty with typing the Or 'II' operator,
Eoin
Hi Mike
I also had the same problems but having spoken to John in the Lab this morning, we don't have to worry about this. In this exercise the 6 numbers don't have to be different.
Barbara
Hi,
The examples we went through today in the tutorial are on moodle.
We avoid two consecutative duplicates in Lotto.java in SimpleLotto.java we don't even try to avoid duplicates.
There is a quicker way to detect duplicates using arrays, but as we haven't covered them yet don't worry about it.
We will go over that again in a couple of weeks.
Rgds,
John