Quinary Bueue

From Esolang
Jump to navigation Jump to search

Quinary Bueue is an esolang by User:ChuckEsoteric08.

Specifcation

0 - enqueue 0
1 - enqueue 1
[ - dequeue, if zero jump after matching ]
] - jump back to matching [

Computational class

Quinary Bueue is Turing-complete because it can simulate brainfuck with fixed amount of unbounded cells. First we should translate brainfuck into a version with wrapping tape. Then we translate it into Quinary Bueue like that:

Create new cell: 0

> becomes:

[1]0

+> becomes:

[1]10

-> becomes:

[1]00, move to this cell, 10

-[ becomes:

[

-]> becomes:

]0

Example: program ++[>+<-] with two cells first becomes:

+>>+>>+>>-[>+>->>+>>-]>>

And then becomes:

00
[1]10
[1]0
[1]10
[1]0
[1]10
[1]0
[
[1]0
[1]10
[1]00[1]0[[1]]0
[1]0
[1]10
[1]0
]0
[1]0