Gdy Brainfuck
Brainfuck in the letters a to g, without its loops, with a print buffer and a little float arithmetic.
Gadai, 2023 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Gadai made Gdy Brainfuck in 2023. It renames brainfuck's + - < > to a b A B, drops the loops and the input, and adds a text buffer and four sums that write into the next cell. The cells hold 32-bit floats, so G divides and e prints a fraction the way C++ does. A program cannot loop, so it always ends.
Read the story
The specification's interpreter starts running at the text gbf1 and a line feed, and the letters of that header run too. b takes the first cell to -1 and f copies that into the second one.
The machine
| Command | Does |
|---|---|
a b | Add or take 1 |
A B | Move right or left |
cX | Add the character X to the buffer |
d C | Print the buffer; empty it |
e | Print the cell as a number |
f F g G | Put left + this, left * this, left - this or left / this in the cell to the right |
Every other character does nothing.
Example
The last c on the second line takes the line feed, so the greeting ends with one.
The last c on the second line takes the line feed, so the greeting ends with one.
The 1+1=2 only comes out right because of the header. Each aa lifts a cell from -1 to 1, and f adds the two into the third cell. Started from zeros, the same letters would print 4.
Further
See also
Gdy Brainfuck builds on Brainfuck.
Brainfuck derivatives
Write your own in Run Convert a program from Gdy Brainfuck
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: gdy-brainfuck.
Command line
shib run gdy-brainfuck -e 'gbf1
c1c+c1c=dC
aaAaafAe'shib manual gdy-brainfuckSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/gdy-brainfuck.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org