in reply to Array Shuffle

List::Util has shuffle().

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: Array Shuffle
by Limbic~Region (Chancellor) on Feb 28, 2006 at 13:58 UTC
    dragonchild,
    Sure List::Util has shuffle() but how does this meet the requirement. Perhaps I am misreading it or perhaps the root thread was updated after you replied but I believe the requirement also mandates that elements not remain in their original position. This is a derangement and I think that Derangement of a list and Derangements iterator are probably more applicable. I also see that frenchtoast had the same idea elsewhere in the thread.

    Cheers - L~R