Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 romping around the Monastery: (17)
As of 2014-07-25 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (174 votes), past polls