Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Random Derangement Of An Array

by BrowserUk (Pope)
on Jul 06, 2008 at 08:25 UTC ( #695801=note: print w/replies, xml ) Need Help??


in reply to Re: Random Derangement Of An Array
in thread Random Derangement Of An Array

Shame that, according to its own documentation, it doesn't work!

Usage : my @deranges = derange(@n); Function: implements !n, a derangement of n items in which none of th +e items appear in their originally ordered place. Example : my @n = qw(a b c); my @d = derange(@n); print join "\n", map { join " ", @$_ } @d; # prints: # a c b ### Not a derangment; a in it's original position # b a c ### Not a derangment; c in it's original position # b c a # c a b # c b a ### Not a derangment; b in it's original position

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2021-03-03 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (77 votes). Check out past polls.

    Notices?