Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

poor man's shuffle :)

by LanX (Canon)
on Mar 27, 2013 at 19:38 UTC ( #1025797=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      DB<228> sort { (-1)**(rand(2)%2)  } 1..10
     => (5, 8, 7, 6, 9, 10, 1, 4, 2, 3)
    
  2. or download this
      DB<483> for (1..100000) {$x=0;$g[$x++]{$_}++ for sort {(-1) ** int r
    +and 2} a..d }
     => ""
    ...
      { a => 24773, b => 24944, c => 25203, d => 25080 },
      { a => 24863, b => 25103, c => 25172, d => 24862 },
    ]
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-08-20 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls