Created
October 4, 2012 20:36
-
-
Save DouglasAllen/3836276 to your computer and use it in GitHub Desktop.
99 Bottles in Shoes. "shoes 99_bottles.rb"
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
Shoes.setup do | |
end | |
def bottle(x) | |
case x | |
when 0 then "no more bottles" | |
when 1 then "1 bottle" | |
else "#{x} bottles" | |
end + " of beer" | |
end | |
window do | |
99.downto(1) do |i| | |
stack do | |
para "#{bottle(i)} on the wall," | |
para "#{bottle(i)}, take one down, pass it around," | |
para "#{bottle(i - 1)} on the wall.\n" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment