From: Li Chen Date: 2009-07-22T11:33:28+09:00 Subject: why I get an empty hash? Hi all, I modify James' code and want to return a hash with all values set to 0. But I only get an empty hash. I wonder what is wrong with my codes. Thanks, Li def table(array,word_size=1,word='') hash_table=Hash.new(0) array.each do |e| if word_size==1 hash_table["#{word+e}" ]=0 else table(array,word_size-1,word+e ) end end return hash_table end ###################### array=['A','C','G','T'] p table(array,2) ### here is ressults:### >ruby table2.rb {} >Exit code: 0 -- Posted via http://www.ruby-forum.com/.