Skip to content

Instantly share code, notes, and snippets.

@taylorlapeyre
Created July 6, 2012 21:52
Show Gist options
  • Save taylorlapeyre/3062961 to your computer and use it in GitHub Desktop.
Save taylorlapeyre/3062961 to your computer and use it in GitHub Desktop.
My shortest fizzbuzz to date
30.times do |num|
puts (num % 15 == 0) ? "Fizzbuzz" : (num % 5 == 0) ? "Fizz" : (num % 3 == 0) ? "Buzz" : num
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment