From: "Ara.T.Howard" Date: 2005-07-28T23:51:46+09:00 Subject: Re: Combination of two arrays On Thu, 28 Jul 2005, why the lucky stiff wrote: > Ara.T.Howard wrote: > >>> >>> harp:~ > cat a.rb >>> foo = [ "a", "b", "c", 'n' ] >>> bar = [ 1 , 2 , 3 , 'm' ] >>> >>> p foo.zip(bar) >>> >>> harp:~ > ruby a.rb >>> [["a", 1], ["b", 2], ["c", 3], ["n", "m"]] >> > I don't want Ara to fail! > >>> (foo * bar.length).sort.zip(bar * bar.length) > => [["a", 1], ["a", 2], ["a", 3], ["a", "m"], ["b", 1], ["b", 2], ["b", 3], > ["b", "m"], ["c", 1], ["c", 2], ["c", 3], ["c", "m"], ["n", 1], ["n", 2], > ["n", 3], ["n", "m"]] > > _why you win _why! nice. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | My religion is very simple. My religion is kindness. | --Tenzin Gyatso ===============================================================================