Created
June 1, 2014 01:34
-
-
Save edunham/af36d34be4fc9fde250f 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
def bottles(n): | |
var foo := "" | |
switch (n) { | |
match == 0 { foo += "No bottles" } | |
match == 1 { foo += "1 bottle" } | |
#match < 3 { foo += "not many"} | |
match _ { foo += `$n bottles` } | |
} | |
return foo | |
var n := 99 | |
while (n > 0): | |
traceln(`${bottles(n)} of beer on the wall, | |
${bottles(n)} of beer. | |
Take one down, pass it around,`) | |
n := n - 1 | |
traceln(`${bottles(n)} of beer on the wall. | |
`) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment