Queuefuck
Jump to navigation
Jump to search
Queuefuck is a language created for the purpose of proving that @!+-() is Turing complete.
Queuefuck operates on a queue of unbounded integer elements. The behavior of the integers at 0 is undefined but unimportant for the proof. E.g. an implementation may allow for negative values, or might have 0 - 1 = 0, or may error.
Commands
. - enqueue zero + - dequeue, increment, enqueue again - - dequeue, decrement, enqueue again ^ - dequeue and enqueue again - q.append(q.pop(0)) " - dequeue and enqueue 2 times - t = q.pop(0); q.append(t); q.append(t) [ - dequeue and if zero go past matching ] ] - go back to matching [ ; - dequeue and output : - enqueue user input / - dequeue
Compiling n-cell brainfuck to queuefuck
Since cells are unbounded, 3-cell brainfuck or general n-cell brainfuck can be compiled into queuefuck.
Note than x(n)
means that command x
is repeated n
times.
initalisation - .(n) + - +^(n-1) - - -^(n-1) > - ^ < - ^(n-1) [ - "^(n-1)[ ] - "^(n-1)] . - "^(n-1); , - /:^(n-1)
Compiling queuefuck to @!+-()
. - (-)@ + - !+@ - - !-@ ^ - !@ [ - !( ] - !) ; - !, : - .@ / - ! " - !@@