From: Ilan Berci Date: 2007-01-10T06:00:21+09:00 Subject: Re: Randomizing an Array? Daniel Waite wrote: > Florian Frank wrote: >> Don't do this, better use (1..10).sort_by { rand }. Your version is >> equivalent to (1..10).sort { 1 } and *always* creates the same >> permutation for this array. > > It's random for me. Both work. Actually Frank is correct, my mistake, it should definetely be sort_by and not sort.. I should have reviewed it more thoroughly before responding.. ilan -- Posted via http://www.ruby-forum.com/.