Kero van Gelder wrote:
>   class Array
>     def shuffle!
>       size.downto(2) do |i|
>         r = rand(i)
>         tmp = self[i-1]
>         self[i-1] = self[r]
>         self[r] = tmp
>       end
>       self
>     end
>   end

How about:

        self[i-1], self[r] = self[r], self[i-1]

Didn't measure the speed...

Happy rubying,

Stephan