Braintwist

From Esolang
Jump to navigation Jump to search

Braintwist is a dialect of Brainfuck designed by Troels Henriksen in 2005. Its only difference from Brainfuck is the introduction of a new operator that allows for self-modifying code.

The new operator, X, swaps the data and code arrays, making it possible to store code in the data array for later execution. Aside from this, Braintwist is identical to Brainfuck, so every Brainfuck program not containing an uppercase letter X will function identically in Braintwist.

Braintwist can be used together with the Brainfork extension, in which case the X instruction only swaps the arrays of the thread calling the instruction. As a result, one thread's code array can be used as another's data array.

Implementations

weave.rb supports Braintwist with the -X flag.

External resources