From: Justin Collins Date: 2006-06-29T08:53:00+09:00 Subject: Re: Sorting arrays On 6/28/06, Nuralanur@aol.com wrote: > You can use the sort method on the entire Array: > > sorted=[1, 2, "three"] > unsorted=[6,5,'four'] > a = sorted+unsorted > b = a.sort { |x,y| x.to_s <=> y.to_s} > =>b is then [1, 2, 5, 6, "four", "three"] (that's because '1' was > compared > to 'four' etc.) > > Best regards, > > Axel > > > Dark Ambient wrote: > Apologies, I can't use array.sort. This is to build my own. > This sounds like a homework problem...? In either case, your description is a little fuzzy. The way you describe it doesn't make sense. This usually means you haven't fully grasped the problem. Before jumping into the programming, write out what you want to accomplish on paper and make certain you completely understand what you wish to do, and how you will go about it. Then try to solve it programmatically. If you have trouble with that piece, come back to the list. That's my advice. Good luck! -Justin