Skip to content

Instantly share code, notes, and snippets.

@marioaquino
Forked from danker/FizzBuzz.groovy
Created November 9, 2010 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marioaquino/668630 to your computer and use it in GitHub Desktop.
Save marioaquino/668630 to your computer and use it in GitHub Desktop.
(1..100).each do |num|
out = num % 3 == 0 ? 'Fizz' : ''
out << 'Buzz' if num % 5 == 0
out = num if out.size == 0
print out
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment