Skip to content

Instantly share code, notes, and snippets.

@manveru
Created June 20, 2010 05:22
Show Gist options
  • Save manveru/445587 to your computer and use it in GitHub Desktop.
Save manveru/445587 to your computer and use it in GitHub Desktop.
Integer bottles = (|
(self == 0) if: [|
"No more bottles"
] else: [|
(self == 1) if: [|
"1 bottle of beer"
] else: [|
(self to-s) + " bottles of beer"
]
]
)
(99 to: 1) do: [n|
(n bottles) + " on the wall, " + (n bottles) + "." puts
"Take one down, pass it around." puts
(n - 1) bottles + " on the wall." puts
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment