We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
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)" or "bottles" 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.
Purpose
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.
List of implementations
Due to the nature of such a program, this page has been split into several subpages.
- 99 bottles of beer/Implementations (nonalphabetic and A-G)
- 99 bottles of beer/Implementations (H-R)
- 99 bottles of beer/Implementations (S-Z)
List of implementations (non-esolangs)
Batch
Note that this is made by Mihai Popa (myself)!
@echo off set x=99 set /a y=%x%-1 :loop echo %x% bottles of beer on the wall, echo %x% bottles of beer. echo Take one down, pass it around, echo %y% bottles of beer on the wall. echo. set /a x=%x%-1 set /a y=%x%-1 if %x% EQU 1 ( echo 1 bottle of beer on the wall, echo 1 bottle of beer. echo Take one down, pass it around, echo No bottles of beer on the wall. pause >nul exit ) goto loop
Uiua
∵(&pf⊂:⨬(⊂:" of beer.\nTake one down,pass it around.\n"⊂:⨬("s"|"")=1:⊂:" bottle"°⋕.|""◌)=0.:⊂:⨬(",\n"|".\n")=0:⊂:" of beer on the wall"⊂:⨬("s"|"")=1:⊂:" bottle"⨬(°⋕|"No"◌)=0....)⇌⇡100
External resources
- 99 Bottles of Beer.net has a collection of 99 B.o.B. programs in over 1500 languages, including many esoteric ones.
- 99 bottles of beer on Rosetta Code
- 99 bottles of beer on CGCC