Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: A bad shuffle

by Tanktalus (Canon)
on Mar 20, 2005 at 21:36 UTC ( #441062=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub shuffle
    {
    ...
        push @out, splice(@in, rand @in, 1) while @in;
        @out;
    }
    
  2. or download this
    use strict;
    
    ...
        push @out, splice(@in, rand @in, 1) while @in;
        @out;
    }
    
  3. or download this
                  Rate random_perm     shuffle
    random_perm 6000/s          --        -30%
    shuffle     8606/s         43%          --
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-08-20 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls