From: 7stud -- Date: 2008-02-17T23:10:29+09:00 Subject: Re: Randomising Angelo Joseph wrote: > Dear All, > I am very new to ruby been learning at university for around 6 > months. I love it. Anway i am making an app for a project at uni which > involving creating a logoquiz game that has random quizzes. I know there > is something called randomisation but not enough on it. can anyone shed > any light. > > > I much appreciate this > Angelo Something like this may be of use to you: quiz_names = ['a', 'b', 'c', 'd', 'e'] random_names = quiz_names.sort_by {|quiz_name| rand(0)} puts random_names --output:-- ["b", "a", "e", "c", "d"] -- Posted via http://www.ruby-forum.com/.