Return to Snippet

Revision: 2041
at December 21, 2006 15:20 by rduv


Initial Code
class Array def shuffle n = [] while !empty? n << delete_at(rand(size)) end n end end # Usage >> [1,2,3,4,5].shuffle => [2, 4, 5, 1, 3]

Initial URL
http://concentrationstudios.com/2006/12/20/12-days-of-stupid-ruby-tricks

Initial Description

                                

Initial Title
concentration studios 12 Days of Stupid Ruby Tricks

Initial Tags

                                

Initial Language
Ruby