Skip to content

Instantly share code, notes, and snippets.

@pragdave
Created September 20, 2010 22:53
Show Gist options
  • Save pragdave/588807 to your computer and use it in GitHub Desktop.
Save pragdave/588807 to your computer and use it in GitHub Desktop.
# A poor implementation of FizzBuzz, just to show code coverage stuff
1.upto(100).with_object('') do |i, x|
if i % 3 == 0
x += 'Fizz'
end
if i % 5 == 0
x += 'Buzz'
end
if x.empty?
puts i
else
puts x
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment