Im trying to generate n unique random numbers between 1 and max
I tried the following code but doesn't work (returns repeated numbers)
r = [ ]
n.times { v = rand(max) while r.include? v ; r << v}
Whats wrong with it? Thanks
added:
max is thousands
n is 10