next
inject
# The sort is needed so it prints fizzbuzz, not buzzfizz
# (hashes being unordered and all)
fooers = the_hash.sort_by {|k,v| k}.map do |k,v|
( Array.new(k - 1, '') << v ).cycle
end
(1..100).each do |number|
fizzbuzz = fooers.map(&:next).inject(:+)
puts ( fizzbuzz.empty? ? number : fizzbuzz )
end