From: Dark Ambient Date: 2006-06-30T05:33:23+09:00 Subject: Re: Sorting arrays I just started going through the replies, thank you all very much! Anyway, this one below, just kind of blows me away so succinct! I guess because it's Ruby. Stuart On 6/29/06, Robert Klemme wrote: > ** more spoilers ** > You can do > > list = ["aword", "cword", "gword", "zword", "dword", "qword", "pword"] > unsorted = list.dup > sorted = [] > until unsorted.empty? #when unsorted is empty, we are done > sorted << unsorted.min #put the smallest value into sorted > unsorted.delete(unsorted.min) #take it out of unsorted > end > p sorted