lib/sixarm_ruby_ramp/array/shuffle.rb
def shuffle!
      each_index do |i|
        j = rand(length-i) + i
        self[j], self[i] = self[i], self[j]
      end
    end
# Randomly arrange the array items.
#
# @return [Array] the array, with its items shuffled.
#
# This implementation is optimized for speed, not for memory use.
# See http://codeidol.com/other/rubyckbk/Arrays/Shuffling-an-Array/
#
# @example
#   list=
#   list=['a','b','c']
#   list.shuffle!
#   list => ['c','a','b']
Randomly arrange the array items.
Randomly arrange the array items .
def shuffle!
      each_index do |i|
        j = rand(length-i) + i
        self[j], self[i] = self[i], self[j]
      end
    end
def shuffle! each_index do | i | j = rand ( length - i ) + i self [ j ] , self [ i ] = self [ i ] , self [ j ] end end
Randomly arrange the array items.
Randomly arrange the array items .
the array, with its items shuffled. This implementation is optimized for speed, not for memory use.
the array with its items shuffled . This implementation is optimized for speed not for memory use .
Array
example
None