Created
June 20, 2010 05:22
-
-
Save manveru/445587 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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