Goldfuck
Every program is the golden ratio, recited with mistakes. The mistakes are the program.
None1, 2023 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
None1 hid brainfuck in phi. A program looks like 1.6180339887... and only the places where it gets a digit wrong carry information. Reading after the point, a right digit stands for ! and a wrong one for # in !!Fuck, which spells each brainfuck command as a run of ! closed by a #. Since most of !!Fuck is !, most of a Goldfuck program is phi itself.
The machine
| Right digits before a wrong one | Command |
|---|---|
| 0 to 4 | nothing |
| 5 6 7 8 | > < + - |
| 9 10 | , . |
| 11 12 | [ ] |
After decoding it is brainfuck on a million byte cells. The Python interpreter decodes the whole program before running it, so right digits after the last wrong one, which close no command, stop the program before it starts.
Example
The Hello World is 549 characters.
The Hello World is 549 characters. Its mistakes decode to a 62-command brainfuck program that prints in lower case. The truth machine reads 0 and prints it once.
The cat is 69 characters. Its six mistakes decode to ,.[,.], which echoes the input and then the 0 it reads at the end.
Further
- esolangs.org/wiki/Goldfuck
- !!Fuck, the encoding underneath
Ideas it shows
See also
Goldfuck builds on Brainfuck.
Brainfuck equivalents
Brainfuck derivatives
Write your own in Run Convert a program from Goldfuck
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: goldfuck.
Command line
shib run goldfuck -e '1.6180339880498948482025868343656371177203090798057628601354486227055' --input 'abc'shib manual goldfuckSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/goldfuck.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org