Hal E. Fulton
3/31/2006 6:04:00 AM
Meino Christian Cramer wrote:
> From: Hal Fulton <hal9000@hypermetrics.com>
> Subject: Re: Most simple way to do "array + array => hash"
> Date: Fri, 31 Mar 2006 14:39:58 +0900
>
> Hi Hal,
>
> no, it seems not (from my irb):
Oops, forgot to flatten.
Hash[*a.zip(b).flatten]
irb(main):004:0> Hash[*a.zip(b).flatten]
=> {"V"=>"V", "K"=>"U", "W"=>"S", "L"=>"K", "A"=>"Z", "X"=>"P", "M"=>"R", "B"=>"X",
"Y"=>"Q", "N"=>"A", "C"=>"M", "Z"=>"O", "O"=>"B", "D"=>"I", "P"=>"H", "E"=>"D",
"Q"=>"E", "F"=>"G", "R"=>"W", "G"=>"F", "S"=>"N", "H"=>"L", "T"=>"Y", "I"=>"T",
"U"=>"C", "J"=>"J"}
Cheers,
Hal