99 bottles of beer
A 99 bottles of beer program is a program solving the popular problem of "singing" the song "99 Bottles of Beer", which goes something like this:
99 bottles of beer on the wall, 99 bottles of beer. Take one down, pass it around, 98 bottles of beer on the wall. 98 bottles of beer on the wall, 98 bottles of beer. Take one down, pass it around, 97 bottles of beer on the wall. ... 1 bottle of beer on the wall, 1 bottle of beer. Take one down, pass it around, No bottles of beer on the wall.
There are, of course, several variations on the song and/or the program. Some variants include the following final verse:
No bottles of beer on the wall, No bottles of beer. Go to the store, buy some more, 99 bottles of beer on the wall.
Some versions ignore the singular form of "bottle" in the case of 1 bottle, using simply "bottle(s)" everywhere instead. Some display the numeral 0 instead of the word "No" for the final count of bottles. These tactics are considered cheating by some, but are nevertheless quite common.
99 Bottles of Beer is often one of the first programs to be written in a new esoteric programming language, to demonstrate that it can loop and halt under a certain condition. While suggestive that the language is "usable for computation", it does not constitute a proof that it is Turing-complete. However, a language can "cheat" over it by printing this message without using a loop. This does not demonstrate that this language is usable for computation.
- 99 Bottles of Beer.net has a collection of 99 B.o.B. programs in over 1500 languages, including many esoteric ones.