Skip to content

Instantly share code, notes, and snippets.

@nowk
Created March 23, 2012 23:10
Show Gist options
  • Save nowk/2176200 to your computer and use it in GitHub Desktop.
Save nowk/2176200 to your computer and use it in GitHub Desktop.
(1..100).each do |n|
puts case
when (n % 3) == 0
"Fizz"
when (n % 5) == 0
"Buzz"
when (n % 3) == 0 && (n % 5) == 0
"FizzBuzz"
else
n
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment