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.
Beer
Beer is an esolang invented by User:None1 and inspired by the lyrics of 99 bottles of beer.
Variables
This esolang uses unbounded signed integer variables. Assigning to a non-existent variable creates it and reading a non-existent variable returns 0.
Current variable
In Beer, current variable is a reference which points to the variable that the last command accessed. Using current variable before any variable is accessed is undefined behavior.
Commands
This esolang is case-insensitive. Periods at the end are optional and can be replaced with commas. Commands are separated by line feeds.
num stands for a number and var stands for a variable.
| Command | Meaning |
|---|---|
num bottles of var on the wall. |
Makes the value of var num. No is an alias of 0. Singular and plural forms aren't checked, so bottle and bottle(s) are also allowed regardless of the number.
|
num bottles of var. |
Ignore the next instruction unless num=var. If there's no next instruction, the program terminates. |
Take one down. |
Decrement current variable. |
Pass it around. |
Output current variable. Whether to output as character or number is implementation-defined. |
Go to the var. |
Jump to the var-th command (0-indexed). This doesn't change current variable. |
Buy some more. |
Increment current variable. |
Examples
Hello, world!
72 bottles of beer on the wall. Pass it around. 101 bottles of beer on the wall. Pass it around. 108 bottles of beer on the wall. Pass it around. 108 bottles of beer on the wall. Pass it around. 111 bottles of beer on the wall. Pass it around. 44 bottles of beer on the wall. Pass it around. 32 bottles of beer on the wall. Pass it around. 119 bottles of beer on the wall. Pass it around. 111 bottles of beer on the wall. Pass it around. 114 bottles of beer on the wall. Pass it around. 108 bottles of beer on the wall. Pass it around. 100 bottles of beer on the wall. Pass it around. 33 bottles of beer on the wall. Pass it around.
Truth Machine
2 bottle of store on the wall. 1 bottles of beer on the wall. Pass it around. 1 bottle(s) of beer. Go to the store.
This is the 1-input program. Change the number in the first line to 0 for a 0-input program.
Computational class
Turing-complete because it can be translated from Minsky machine quite easily.