Robert Klemme wrote:
> On 17.02.2008 15:10, 7stud -- wrote:
>
>> quiz_names = ['a', 'b', 'c', 'd', 'e']
>>
>> random_names = quiz_names.sort_by {|quiz_name| rand(0)}
>
> You do not need the block parameter.
>
I know. I also don't need the parameter for rand(). However, both make
the code easier to follow--especially for someone new.
--
Posted via http://www.ruby-forum.com/.