|Designed by||Joshua Barretto|
|Computational class||Turing complete|
|Reference implementation||Hanoifuck C Interpreter|
Hanoifuck is an esoteric programming language invented by Joshua Barretto. It draws influence from Brainfuck, but swaps Brainfuck's tape-driven memory model for a multi-stack LIFO memory model similar in conception to the 'Towers of Hanoi' puzzle game.
Syntactically, and in terms of code execution, Hanoifuck behaves exactly like Brainfuck. However, it differs in the instructions it has and the way in which they operate upon the memory model.
Hanoifuck's memory model is composed of 3 independent LIFO stacks of bytes. Each stack can have bytes push onto them or popped off them (through various operations). At any one moment, only one of the stacks is operated upon. The
! instruction is used to switch between each of the stacks in turn.
||Addition: Pop the two most recent values off the current stack as |
||Subtraction: Pop the two most recent values off the current stack as |
||One: Push the value |
||Swap: Switch to the next of the three stacks, looping if necessary|
||Read: Read a single character from stdin, replace the item at the top of the current stack (similar to Brainfuck)|
||Write: Write the ASCII value of the item at the top of the current stack to stdout (similar to Brainfuck)|
||Skip forward: As in Brainfuck, skip forward to the next matching |
||Skip backward: As in Brainfuck, skip backward to the next matching |
A simple example that outputs
HELLO to the console: