Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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?
[Eily]: oh no, how am I going to answer to that prince who wanted to leave me all this money?
[Eily]: and all those mails to enlarge my
[Eily]: inbox
[marto]: I'm happy to be the middle man :P
LanX found a bone xylophone for node reaper massage
[Veltro]: NodeReaper did not notice messages from Klaas Vaak, lucky Eily...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2018-05-23 14:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?