Beer
Every line is a line from 99 bottles of beer, and the song is the program.
None1, 2026 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
None1 made Beer in 2026 from the lyrics of the drinking song. A program is one command per line, and every command reads like the song. Each variable is a whole number of any size, and the wall is where you write one. The specification calls it Turing complete, because a Minsky machine translates into it.
The machine
| Line | Does |
|---|---|
n bottles of v on the wall. | Set v to n (No is 0) |
n bottles of v. | Skip the next line unless v is n |
Take one down. | Take 1 from the current variable |
Buy some more. | Add 1 to the current variable |
Pass it around. | Print the current variable as a character |
Go to the v. | Jump to line v, counted from 0 |
The current variable is the last one a set or a test named, and a jump leaves it as it is. Case does not matter, the dot at the end may be a comma or nothing, and bottle or bottle(s) work for any number. The run ends after the last line.
Example
Two characters, 72 and 105.
Two characters, 72 and 105.
A loop over the alphabet. The variable top holds line 3 and end holds line 8, one past the last. The test on line 5 lets Go to the end. run only when beer reaches 91.
The truth machine sets store to 2 and loops back to Pass it around. while beer is 1. With 0 it prints one character with code 0 and stops.
Further
Ideas it shows
See also
Pseudonatural
Write your own in Run Convert a program from Beer
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: beer.
Command line
shib run beer -e '2 bottle of store on the wall.
0 bottles of beer on the wall.
Pass it around.
1 bottle(s) of beer.
Go to the store.'shib manual beerSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/beer.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org