fizzbuzz/fizzbuzz.rb

7 lines
153 B
Ruby
Raw Normal View History

2010-06-26 16:54:40 +00:00
#!/usr/bin/env ruby
(1..100).each do |x|
print "Fizz" if 0 == (x % 3)
print "Buzz" if 0 == (x % 5)
print "\n" if 0 == (x % 3) || 0 == (x % 5)
end