This is what I have so far:
myArray.map!{ rand(max) }
Obviously, however, sometimes the numbers in the list are not unique. How can I mak
Based on Kent Fredric's solution above, this is what I ended up using:
def n_unique_rand(number_to_generate, rand_upper_limit) return (0..rand_upper_limit - 1).sort_by{rand}[0..number_to_generate - 1] end
Thanks Kent.