Brainthon
Made to print text in the worst way possible. Every letter is counted out in brains.
Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Brainthon has two emoji. A brain counts the current character code up by 1, and a snake adds the character with that code to a string. A line that holds only two snakes prints the string. Each line counts from 0 again, so a letter costs as many brains as its code, 72 for H and 119 for w.
Read the story
The Hello world program is 12 lines and 1,084 brains. Its interpreter is 13 lines of Python, and because it prints with Python's print, every printed string ends with a line feed.
The machine
| Code | Does |
|---|---|
| 🧠 | Count the code on this line up by 1 |
| 🐍 | Add the character with that code to the string |
| 🐍🐍 on a line of its own | Print the string and a line feed, then empty it |
A new line starts the code at 0 again, and every other character is skipped. There is no input and no loop, so every program stops. esolangs.org files it under total and unusable for programming.
Example
H is 72 brains and a snake, then the line that prints.
H is 72 brains and a snake, then the line that prints.
Hi takes one more line, with 105 brains for the i.
Patterns it teaches
- Encoding tricks: every character code is written in unary, as a row of brains.
Further
See also
Also in Jokes
Write your own in Run Convert a program from Brainthon
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: brainthon.
Command line
shib run brainthon -e '🐍🐍'shib manual brainthonSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/brainthon.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org