Forum: Ruby Re: FizzBuzz (#126)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
3d6a0579b21b0c1c72606f66b4041cbb?d=identicon&s=25 Federico Zagarzazú (Guest)
on 2007-06-04 05:35
(Received via mailing list)
Finally a quiz for newbies like me. :)

ARGV[0].to_i.upto(ARGV[1].to_i) do |x|
  puts case [15,5,3].find {|i| x % i == 0}
    when 15 : 'FizzBuzz'
    when 5  : 'Buzz'
    when 3  : 'Fizz'
    when nil: x

Thanks a lot for the quizzes, I'm teaching myself ruby with them.

ps: Is it ok to send solutions of previous quizzes?
This topic is locked and can not be replied to.