Please Forward: Ruby Quiz Submission

From: "Rene Koning" <rene.koning@gmail.com>
Date: June 1, 2007 9:22:37 AM CDT
To: submission@rubyquiz.com
Subject: Please Forward: Ruby Quiz Submission

Quiz #126

I don't know if they would hire me, but this is what I would come up with in the mentioned circumstances:

class Fixnum
def dividable_by?(num)
  self % num == 0
end
end

(1..100).each do |num|
puts case true
  when num.dividable_by?(3*5): "fizzbuzz"
  when num.dividable_by?(5): "buzz"
  when num.dividable_by?(3): "fizz"
  else num.to_s
end
end

···

Begin forwarded message: