Skip to content

Instantly share code, notes, and snippets.

@DylanFM
Created January 31, 2009 04:44
Show Gist options
  • Save DylanFM/55439 to your computer and use it in GitHub Desktop.
Save DylanFM/55439 to your computer and use it in GitHub Desktop.
#!/usr/local/bin ruby19
#I'll fix this eventually.
99.downto(1) do |bottles|
f = Fiber.new do |bottles|
"#{bottles} bottles of beer on the wall, #{bottles} bottle#{bottles == 1 ? '':'s'} of beer.
Take one down and pass it around, #{bottles-1} bottle#{bottles == 1 ? '':'s'} of beer on the wall."
end
puts f.resume(bottles)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment