How dare you fuck the brain
Brainfuck where a loop starts at a line break and the doubling is done with copy and add.
Ractangle, 2024 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
Ractangle's language, HDYFTB for short, keeps brainfuck's tape but spells it with letters and arrows: I and D for up and down, ^ and v to move. A loop has no opening bracket. ) jumps back to the last line break or | while the cell is not 0, so loops cannot nest. What it adds is arithmetic between neighbours. = copies a cell into the next one and + adds it back, so =+ doubles a cell. A claw can carry one value to any cell.
The machine
| Command | Does |
|---|---|
I D | Add or take one |
^ v | Move right or left |
= | Copy the cell into the next one |
+ | Add the next cell into this one and empty the next |
↑ ↓ | Pick the cell up with the claw; put the claw down into the cell |
P N | Print the cell as a character or as a number |
; | Read a number |
/ | Skip the next command if the cell is not 0 |
) | Jump back to the last line break or \| if the cell is not 0 |
H | Halt |
-> starts a comment. The specification also lists G, a goto, but does not say where it goes, so this implementation stops with an error there.
Example
The Hello World starts with 2 and doubles it with =+ until it has 64.
The Hello World starts with 2 and doubles it with =+ until it has 64. The specification calls it Hello, world!, but it prints no comma. The last program counts down the number it reads in one cell and up in the next, printing each step.
Ideas it shows
See also
How dare you fuck the brain builds on Brainfuck.
Brainfuck derivatives
Cell-based
Write your own in Run Convert a program from How dare you fuck the brain
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: how-dare-you-fuck-the-brain.
Command line
shib run how-dare-you-fuck-the-brain -e ';=;+NH' --input '3 5'shib manual how-dare-you-fuck-the-brainSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/how-dare-you-fuck-the-brain.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org