esolang

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

Expected: A

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.

SumNameDoes
0NOPNothing
1WRTPrint the byte at the memory pointer
2RDRead a byte into it
3IFIf the byte is 0, jump past the matching EIF
4EIFIf the byte is not 0, jump back past the matching IF
5FWDMove the memory pointer forward by the next byte + 1
6BAKMove it back by the next byte + 1
7INCAdd the next byte + 1
8DECSubtract the next byte + 1
9CONConnect to the address at the memory pointer
10ENDEnd 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.
Expected: hi

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.

The fixed 64 KB memory keeps it from being Turing complete in the strict sense.

Further

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 l33t

Source

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