l33t
Brainfuck written in leet speak. Only the digits in each word count.
Stephen McGreal and Alex Mole · Turing complete: with unbounded memory · ●●○ moderate · esolangs.org
Tested with 3 known programs · Hello World on Try It Online: identical · Test method
Run it
The idea
Stephen McGreal and Alex Mole made l33t to look like the way crackers type. Every word becomes a number, the sum of its digits, and that number is an instruction. l4m3R is 4 + 3 = 7, which is INC. Letters, punctuation and words without digits are free, so a program can be a rant about Quake clans.
Read the story
Under the joke it is close to brainfuck, with two twists. The program and the data share one 64 KB memory, so a program can rewrite its own instructions. And the spec even has an instruction to open a network connection.
The machine
The words are loaded as bytes at the start of a 64 KB memory that wraps. The instruction pointer starts at 0 and the memory pointer just after the program.
| Sum | Name | Does |
|---|---|---|
| 0 | NOP | Nothing |
| 1 | WRT | Print the byte at the memory pointer |
| 2 | RD | Read a byte into it |
| 3 | IF | If the byte is 0, jump past the matching EIF |
| 4 | EIF | If the byte is not 0, jump back past the matching IF |
| 5 | FWD | Move the memory pointer forward by the next byte + 1 |
| 6 | BAK | Move it back by the next byte + 1 |
| 7 | INC | Add the next byte + 1 |
| 8 | DEC | Subtract the next byte + 1 |
| 9 | CON | Connect to the address at the memory pointer |
| 10 | END | End the program |
Network connections are left out. CON to address 0, which means the screen, does nothing.
Example
The first is INC (3 + 4) by the next word plus 1.
The first is INC (3 + 4) by the next word plus 1. That word sums to 64, so the cell becomes 65, A. Then WRT (1) prints it and END (5 + 0 + 5) stops. The second reads and prints two bytes. The hello world is a whole essay on being l33t, and it prints H3LL0 W0RLD!!!.
Patterns it teaches
The fixed 64 KB memory keeps it from being Turing complete in the strict sense.
- Camouflage: the program hides in the digits of a text that reads as something else.
- Self-modifying code: code and data are the same bytes.
The fixed 64 KB memory keeps it from being Turing complete in the strict sense.
Further
See also
l33t builds on Brainfuck.
Unknown year
Self-modifying
Write your own in Run Convert a program from l33t
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: l33t.
Command line
shib run l33t -e '2 1 2 1 55' --input 'hi'shib manual l33tSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/l33t.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org