Created
January 31, 2009 04:44
-
-
Save DylanFM/55439 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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