There's more than one way to do things | |
PerlMonks |
Re^3: Non-Repetitive Random Numbersby LanX (Saint) |
on Apr 05, 2013 at 14:54 UTC ( [id://1027148]=note: print w/replies, xml ) | Need Help?? |
I don't understand your point (and I'm too much in a hurry ATM to investigate your code) Keys of a hash are always unique, in my code collisions of random numbers are simply ignored.
update> That doesn't guarantee unique values. maybe this is clearer:
updateone could argue that the order of hash -keys isn't random but that wasn't part of the question.Otherwise thats a good occasion to use shuffle or pushing into an array (but this implies reseeding rand every time)
Cheers Rolf ( addicted to the Perl Programming Language)
In Section
Seekers of Perl Wisdom
|
|