Skip to content

Instantly share code, notes, and snippets.

@danker
Forked from marioaquino/FizzBuzz.rb
Created November 9, 2010 04:23
Show Gist options
  • Save danker/668695 to your computer and use it in GitHub Desktop.
Save danker/668695 to your computer and use it in GitHub Desktop.
(1..100).each { num ->
out = ((num % 3) == 0) ? 'Fizz' : ''
if ((num % 5) == 0) out += 'Buzz'
if (out.length() == 0) out = num
println out
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment