Skip to content

Instantly share code, notes, and snippets.

@djgraham
Created April 6, 2011 12:02
Show Gist options
  • Select an option

  • Save djgraham/905535 to your computer and use it in GitHub Desktop.

Select an option

Save djgraham/905535 to your computer and use it in GitHub Desktop.
1.upto(100) do |i|
string = ""
string+= "Fizz" if i % 3 == 0
string+= "Buzz" if i % 5 == 0
string+= i.to_s if string.empty?
puts string
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment