Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Re: Re: random elements from array - new twist

by SpaceAce (Beadle)
on Nov 07, 2002 at 08:06 UTC ( #211016=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: random elements from array - new twist
in thread random elements from array - new twist

It isn't very efficient, though, is it? Every time the loop runs, it has to pick a random number and check/assign the hash key. It could pick the same element several times since the array doesn't change. Also, if for any reason that array was less than five unique elements long you would get an endless loop. SpaceAce
  • Comment on Re: Re: Re: Re: random elements from array - new twist

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://211016]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2020-10-24 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (243 votes). Check out past polls.

    Notices?