shuffle()
Returns a new array with elements of this array shuffled.
a = [ 1, 2, 3 ] #=> [1, 2, 3] a.shuffle #=> [2, 3, 1]
static VALUE rb_ary_shuffle(VALUE ary) { ary = rb_ary_dup(ary); rb_ary_shuffle_bang(ary); return ary; }
sample randomly picks 1 or n elements from the array