Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

When the Best Solution Isn't

by sauoq (Abbot)
on Sep 23, 2002 at 01:00 UTC ( #199981=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @random = sort { .5 <=> rand(1) } @array;    # DO NOT USE THIS!
    
  2. or download this
    $ perl -le '@n=(1..3);for(1..100000){@m=sort{.5<=>rand}@n;$h{"@m"}++}f
    +or(sort{$h{$b}<=>$h{$a}}keys%h){print"$_: $h{$_}"}'
    1 2 3: 24990
    ...
    1 3 2: 12541
    3 1 2: 12514
    3 2 1: 12491
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://199981]
Approved by rob_au
Front-paged by gmax
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2019-11-20 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (103 votes). Check out past polls.

    Notices?