EE
Brainfuck with names. A function is declared once and called by its name in brackets.
Goldos24 and MisterJaJo, 2019 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Goldos24 and MisterJaJo made EE in 2019. It keeps all of brainfuck, so every brainfuck program is an EE program, and adds eight commands. Two of them move a value through one extra cell, the accumulator. The other six declare, call and leave functions with names.
Read the story
The Hello World declares one function per character. "H" sets the cell to 8 times 9, "e" to 10 times 10 plus 1, and the program itself is a list of calls, each followed by . to print.
The machine
| Command | Does |
|---|---|
> < + - . , [ ] | As in brainfuck |
$ | Copy the cell into the accumulator |
§ | Paste the accumulator into the cell |
"name" {body} | Declare a function |
(name) | Call it |
; | Return; the end of a body returns too |
There is no if. The specification builds one from brackets. {[(f);]} calls f when the cell is not 0, and {](f);[} calls it when the cell is 0, with the ] in front pairing with the [ behind it. Cells are bytes that wrap, and a ; outside a function ends the program.
Example
The first copies the input byte one cell to the right through the accumulator.
The first copies the input byte one cell to the right through the accumulator. The second calls f, which prints A, only while the cell is 0. After one + the second call does nothing, so A prints once.
Patterns it teaches
- Turing tarpit: brainfuck with functions on top, and still no way to name a value.
Further
See also
EE builds on Brainfuck.
Brainfuck derivatives
Cell-based
Write your own in Run Convert a program from EE
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: ee.
Command line
shib run ee -e '"f" { Place your function content here }
"if_zero_call_f" {](f);[} declaring a function which is the same as an if statement
(if_zero_call_f) call this function when you want to use the if statement'shib manual eeSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/ee.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org