From: Pat Maddox Date: 2006-01-03T19:03:42+09:00 Subject: sort_by{rand} doesn't shuffle array I did some searching on how to shuffle an array, and found sort_by{rand}. However, if I call it, it doesn't make a change to my array at all. I've got a class like this class MyClass def initialize # Populate the array @my_array = Array.new ... end def shuffle! @my_array.sort_by{rand} end end If I call shuffle! from my code, the array's elements are still in the order that they were created. Why are they not being shuffled like I want?