From: Gareth Adams Date: 2008-01-18T18:19:39+09:00 Subject: Re: [SUMMARY] Counting Cards (#152) Ruby Quiz grayproductions.net> writes: > size.times do |i| > j = rand(size) > @shoe[i],@shoe[j] = @shoe[j],@shoe[i] > end > (the code is just a longhand form of @shoe.sort_by { rand }). Easy to think that, but this is the exact same definition of a "naive algorithm" demonstrated recently and very well summed up by Jeff Atwood: http://www.codinghorror.com/blog/archives/001015.html Gareth