Skip to content

Instantly share code, notes, and snippets.

@wandernauta
Created January 24, 2011 15:53
Show Gist options
  • Save wandernauta/793413 to your computer and use it in GitHub Desktop.
Save wandernauta/793413 to your computer and use it in GitHub Desktop.
99 Bottles of Beer in ooc!
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