Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Random Derangement Of An Array

by Anonymous Monk
on Jul 06, 2008 at 07:53 UTC ( #695798=note: print w/replies, xml ) Need Help??

in reply to Random Derangement Of An Array

Replies are listed 'Best First'.
Re^2: Random Derangement Of An Array
by BrowserUk (Pope) on Jul 06, 2008 at 08:25 UTC

    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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2021-03-03 12:39 GMT
Find Nodes?
    Voting Booth?
    My favorite kind of desktop background is:

    Results (78 votes). Check out past polls.