Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Random array sorting

by ikegami (Pope)
on Dec 05, 2007 at 18:41 UTC ( #655169=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Random array sorting
in thread Random array sorting

Ignoring that it doesn't work, I don't see how

print $_, "\n" foreach (sort {int(rand(3))-1} @array);

is easier than

print $_, "\n" foreach shuffle @array;


Comment on Re^3: Random array sorting
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2014-09-21 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (172 votes), past polls