<p>This is what I have so far:  </p>

<pre><code>myArray.map!{ rand(max) }
</code></pre>

<p>Obviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then just pick the n unique numbers?</p>

<p><strong>Edit:</strong><br>
I'd really like to see this done w/o loop - if at all possible.</p>

You could use a hash to track the random numbers you've used so far:
```
```
seen = {}
max = 100
(1..10).map { |n|
  x = rand(max)
  while (seen[x]) 
    x = rand(max)
  end
  x
}
```
```