Fuckhard
Brainfuck on bits that can be set but never cleared, where the only way left is all the way home.
Umnikos, 2024 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 6 known programs · Test method
Run it
The idea
Umnikos made Fuckhard in 2024 to be brainfuck, only harder to use. Each cell holds one bit, and once a cell is 1 nothing makes it 0 again. Data cannot change in place, so a program copies it to fresh cells over and over. < does not step left. It sends the head back to the first cell, and a program counts its way right from there.
Read the story
The brackets come in two kinds. ( jumps forward to its ) and ] jumps back to its [, both only when the cell is 1. Round brackets pair only with round ones and square with square, so the two kinds may cross.
The machine
| Command | Does |
|---|---|
> | Move the head one cell right |
< | Move the head back to the first cell |
+ | Set the cell to 1 |
. | Print the cell's bit |
, | Read a bit; a 1 sets the cell to 1 |
( | If the cell is 1, jump forward to the matching ) |
] | If the cell is 1, jump back to the matching [ |
[ and ) do nothing; they only mark where a jump lands. A jump whose bracket has no partner halts the program. Every other character is a comment. Bits go in and out as the characters 0 and 1.
Example
The cat of 1s prints each 1 it reads and halts on the first 0.
The cat of 1s prints each 1 it reads and halts on the first 0. +( sets the first cell and jumps over the print the first time around.
A number is that many 1s and a 0. The adder is the cat twice, and then it prints the 0 it stopped on. 2 and 3 give 5.
The multiplier keeps the first number on the tape. For each 1 of the second number it goes home with < and prints the first number again, so 2 times 3 prints six 1s.
The specification shows Fuckhard is Turing complete with Olus2000's bitwise cyclic tag, 42 lines with its notes, and it runs too. Fed the program 100 and the data 11 it prints each data bit it deletes, 1100, and halts when the data is empty.
Patterns it teaches
- Turing tarpit: seven commands on bits that never go back to 0.
- Tag systems: the proof of its power is a bitwise cyclic tag interpreter.
Further
See also
Fuckhard builds on Brainfuck.
Brainfuck derivatives
Cell-based
Write your own in Run Convert a program from Fuckhard
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: fuckhard.
Command line
shib run fuckhard -e ',[.]' --input '0'shib manual fuckhardSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/fuckhard.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org