From: Harry Kakueki Date: 2012-10-20T21:24:06+09:00 Subject: Re: Hash with Integer key issue > > Or you could generate it like this. It depends on what you are trying to do. > > > x = Hash.new > 49.downto(1).each { |y| x[y] = y-2 } > p x > > > Actually, you do not need the #each. x = Hash.new 49.downto(1) {|y| x[y] = y-2} p x Harry