Skip to content

Instantly share code, notes, and snippets.

@hoppula
Created November 18, 2011 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoppula/1376740 to your computer and use it in GitHub Desktop.
Save hoppula/1376740 to your computer and use it in GitHub Desktop.
ruby fizzbuzz
(1..100).each do |i|
s = "#{'Fizz' if (i%3).zero?}#{'Buzz' if (i%5).zero?}"
puts s.empty? ? i : s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment