Skip to content

Instantly share code, notes, and snippets.

@DouglasAllen
Created October 4, 2012 20:36
Show Gist options
  • Save DouglasAllen/3836276 to your computer and use it in GitHub Desktop.
Save DouglasAllen/3836276 to your computer and use it in GitHub Desktop.
99 Bottles in Shoes. "shoes 99_bottles.rb"
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