On Fri, Sep 9, 2011 at 7:24 PM, Aaron D. Gifford <astounding / gmail.com> wro=
te:
> Or using just the list of words and Ruby 1.9:
>
> =A0ansi =3D %w{Alpha Bravo Charlie Delta ...... Zulu}
> =A0zippedhash =3D Hash[ansi.map{|x| x[0].downcase}.zip(ansi)]
>
> @Adam Prescott, I think you're right about 1.8, which is why I
> prefaced my response with "This works in 1.9 at least." =A0*chuckle*

or - avoiding the temporary Array:

ansi =3D %w{Alpha Bravo Charlie Delta ...... Zulu}
hash =3D {}
ansi.each {|w| hash[w[0].upcase] =3D w}

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/