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.