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%          --