I am working on http://rubyquiz.com/quiz28.html and am almost done except for one little bug.
In the following: prompts is an array, which for arguments sake is ["one", "two", "three", "three", "four]
def ask_reader(prompts)
@answers = {}
for p in prompts
puts "Give me a #{p}"
@answers[p] = gets.chomp
end
end
This works fine and I get an answers hash with the corresponding answers, except that the second answers[p] will override the first one, thus leaving me with only one value for "three". Is there good 'ruby' way of solving this? Thanks.