Very nice.
Take another look at my solution (which also doesn't deal with a list). For picking relatively few items from large ranges, my solution should be much faster than yours. But I can certainly see situations where I'd prefer yours over mine (for example, if I wanted the items returned in sorted order).
I plan to make iterator versions of both.
- tye
In reply to Re^2: Select three random numbers between 1..10 (nice)
by tye
in thread Select three random numbers between 1..10
by Perl_User
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |