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

poor man's shuffle :)

by LanX (Saint)
on Mar 27, 2013 at 19:38 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1025797]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-24 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found