Skip to content

Instantly share code, notes, and snippets.

@jschank
Last active June 5, 2018 09:52
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jschank/9295418 to your computer and use it in GitHub Desktop.
#! /usr/bin/ruby
fizzy = [1,0,0]
buzzy = [1,0,0,0,0]
1.upto(100) do |i|
fizzy.rotate!
buzzy.rotate!
str = i.to_s * (1 - (fizzy[0] | buzzy[0]))
str << "Fizz" * fizzy[0]
str << "Buzz" * buzzy[0]
puts str
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment