From: "Carlos J. Hernandez" Date: 2008-01-07T02:57:04+09:00 Subject: Re: add rankings to array? # soprano: # How about just listA = [["A",30], ["B",20], ["C",10], ["D",20]] # Or listH = { "A"=>30, "B"=>20, "C"=>10, "D"=>20 } # Then sort the list listSA = listA.sort{|a,b| ret = b[1]<=>a[1]; (ret==0)? a[0]<=>b[0]: ret} # Works also with listH listSH = listH.sort{|a,b| ret = b[1]<=>a[1]; (ret==0)? a[0]<=>b[0]: ret} On Mon, 7 Jan 2008 02:30:13 +0900, "soprano" said: > Is it possible to add rankings to an array (allowing ties):....