From: seebs@... (Peter Seebach) Date: 2007-04-30T12:02:48+09:00 Subject: Re: sorting by rand? In message <55DCC0B4-DF5C-4D70-99E8-78D1572DDD16@sbcglobal.net>, Gary Wright writes: >On Apr 29, 2007, at 10:28 PM, Peter Seebach wrote: >> l = a.length >> a.each_index { |x| a[x] = a[rand(l)] } >You are trashing your original array. True. That said, with the apparent speed difference, it's probably worth copying and then shuffling. -s