in reply to Non-Repetitive Random Numbers
DB<109> %seen=(); DB<110> $seen{int rand 10000}=1 while (keys %seen <10) DB<111> keys %seen => (4402, 3312, 9339, 1345, 3461, 9357, 1185, 4646, 6571, 1315)
... and I don't think it's less efficient than the others.
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Non-Repetitive Random Numbers
by BrowserUk (Patriarch) on Apr 05, 2013 at 14:32 UTC | |
by LanX (Saint) on Apr 05, 2013 at 14:54 UTC | |
by BrowserUk (Patriarch) on Apr 05, 2013 at 15:24 UTC |