Skip to content

Instantly share code, notes, and snippets.

@jschank
Last active June 5, 2018 09:52
Show Gist options
  • Save jschank/9295418 to your computer and use it in GitHub Desktop.
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