From: Harry Kakueki Date: 2007-07-22T13:52:15+09:00 Subject: Re: Method to return elements of an array in numeric 'rank'? On 7/22/07, Jenny Purcell wrote: > > I realize it would be easier for people in the fgroup to follow if I > was programming with objects. However, I just don't understand OO > programming, my skills (such as they are) are procedural. > > Ruby was pointed out to me as a language that would allow me to write > procedural programs and so far it is working out very nicely in that > regard. > Would something like this work? arr = [[1,7],[3,2],[4,9],[2,3]] # [[horse,score],[horse,score] etc.] arr.sort! {|x,y| y[1] <=> x[1]} p arr Harry -- A Look into Japanese Ruby List in English http://www.kakueki.com/