We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Brainqueue

From Esolang
Jump to navigation Jump to search

Brainqueue is an esolang by User:Hammy which is essentially brainfuck if it had a queue instead of a tape.

Commands

Command Meaning
+ Enqueue 1.
- Dequeue.
< Roll the front of the queue to the back of the queue.
> The "cut" instruction. Dequeue a value, call it x. Get the xth value zero-indexed from the back of the queue and put it at the front of the queue.
. I/O. Dequeue a value. If it is 0, input a character and enqueue. Otherwise, dequeue another value and output as ASCII.
, Add the two values at the front of the queue together, and enqueue the result.
[ Start a loop while the front of the queue isn't 0.
] End a loop.
_ Negate the value at the front of the queue. Only added so input was possible with ..
: Duplicate the front of the queue. Only added for convenience.

Examples

Cat program

+:_,.[+<.+:_,.]