Created
January 24, 2011 15:53
-
-
Save wandernauta/793413 to your computer and use it in GitHub Desktop.
99 Bottles of Beer in ooc!
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
bottles := 99 | |
while (bottles >= 0) { | |
if (bottles >= 2) { "%d bottles of beer on the wall, %d bottles of beer." printfln(bottles, bottles) } | |
if (bottles == 1) { "1 bottle of beer on the wall, 1 bottle of beer." println() } | |
if (bottles == 0) {"No more bottles of beer on the wall, no more bottles of beer." println() } | |
if (bottles >= 2) { "Take one down and pass it around, %d bottles of beer on the wall.\n" printfln(bottles-1) } | |
if (bottles == 1) { "Take one down and pass it around, no more bottles of beer on the wall.\n" println() } | |
if (bottles == 0) { "Go to the store and buy some more, 99 bottles of beer on the wall.\n" println() } | |
bottles = bottles - 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment