From: "William (Bill) Froelich" Date: 2007-06-03T23:07:34+09:00 Subject: Re: [QUIZ] FizzBuzz (#126) Here was my first attempt that was around 5 minutes of effort. After thinking about it more I ended up writing a second version (also below) that was less creative. --Bill # First attempt (1..100).each { |n| if n % 3 == 0 then print "Fizz" end if n % 5 == 0 then print "Buzz" end if (n%3 != 0) and (n%5 != 0) then print n end print "\n" } # Second Attempt (1..100).each { |n| case when (n%3 == 0) && (n%5 == 0) then puts "FizzBuzz" when (n%3 == 0) then puts "Fizz" when (n%5 == 0) then puts "Buzz" else puts n end }