Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

RE: RE (tilly) 2: Randomize an array

by BooK (Curate)
on Sep 08, 2000 at 00:46 UTC ( #31480=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sort { rand(3) - 1 } @array
    
  2. or download this
    sort { (-1,1)[rand 2] } @array
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (13)
As of 2019-05-27 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (156 votes). Check out past polls.

    Notices?