T
Tom Eaton
Hi,
I have:
myarray = Array.new
mylist = [1,2]
mylist2 = [3,1]
mylist3 = [2,1]
myarray.push(mylist)
myarray.push(mylist2)
myarray.push(mylist3)
myarray.sort
myarray.each do |x|
puts x[0]
end
And I would like to be able to sort myarray by the first or second
elements in the mylists...
I have been on this problem for a few hours, ay help would be
appreciated.
I have:
myarray = Array.new
mylist = [1,2]
mylist2 = [3,1]
mylist3 = [2,1]
myarray.push(mylist)
myarray.push(mylist2)
myarray.push(mylist3)
myarray.sort
myarray.each do |x|
puts x[0]
end
And I would like to be able to sort myarray by the first or second
elements in the mylists...
I have been on this problem for a few hours, ay help would be
appreciated.