Skip to content

Instantly share code, notes, and snippets.

@kyletolle
Created November 20, 2012 16:16
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 kyletolle/4118919 to your computer and use it in GitHub Desktop.
Save kyletolle/4118919 to your computer and use it in GitHub Desktop.
My FizzBuzz implementation
(1..100).each do |n|
o = ""
o << "Fizz" if (n % 3) == 0
o << "Buzz" if (n % 5) == 0
puts "#{o.empty? ? n : o}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment