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
|
|---|