Queueue
Jump to navigation
Jump to search
Queueue (intentional misspelling of Queue) is an esoteric programming language made by User:Rehydratedmango.
Overview
All data in Queueue is stored in queues, which can be further nested in bigger queues. Program execution begins with a single master queue.
Commands
| Command | Description |
|---|---|
| queue # to "queue" | Queue an integer to a queue |
| queue "queue" to "queue" | Queue a queue to another queue |
| new "queue" | Define a new queue |
| forget "queue" | Delete a queue |
| queue # to "queue" ?"queue"=="queue" | Queue an integer to a queue if two queues are equal |
| queue "queue" to "queue" ?"queue"=="queue" | Queue a queue to a queue if two queues are equal |
| output from "queue" | Dequeue the next item in the queue and print it. If the value is a queue, each value inside the queue will be printed as an ASCII character |
| input to "queue" | Get input from the user. Each character they type will be queued as an ASCII code |
| transfer from "queue" to "queue" | Dequeue the next item in the first queue and queue it to the second queue |
| queue $"string" to "queue" | Queue every ASCII code, one after the other, to a queue |
| in "queue" do {code} | For every value in the queue, dequeue it and execute some code. The dequeued value can be referenced with "i" |
| for # do {code} | Repeat some code # times. The current loop number can be referenced with "i" |
| while "queue"=="queue" do {code} | While the two queues are equal, execute some code |
| # + # | Returns the sum of two integers |
| # - # | Returns the difference of two integers |
| # * # | Returns the product of two integers |
| # / # | Returns the quotient of two integers |
| # % # | Returns the remainder of two integers |
A queue name beginning with # (as in #"main") refers to the length of the queue. This is the only way to store variables in Queueue.
Queueue has some special queue names that cannot be deleted. These are:
- main (main queue)
- empty (an empty queue; cannot be modified)
- garbage (queue is automatically cleared after every instruction)
- i (queue containing the current loop data in loops)
Computational class
qoob can be translated into Queueue, meaning it is Turing complete.
Translated programs have a preamble:
new "check" new "one" queue 1 to "one"
The 0 and 1 instructions are straightforward:
queue 0 to "main" queue 1 to "main"
The loop construct assumes that transferring from an empty queue is valid:
transfer from "main" to "check"
while "check"=="one" do {
transfer from "check" to "garbage"
code here
transfer from "main" to "check"
}
transfer from "check" to "garbage"
Examples
Hello, world!
new "hello" queue $"Hello, world!" to "hello" queue "hello" to "main" output from "main"
Truth machine
new "state"
input to "state"
new "one"
queue $"1" to "one"
while "state"=="one" do
{
queue "state" to "main"
output from "main"
}
queue "state" to "main"
output from "main"
Fibonacci
new "n-2"
new "n-1"
new "n"
queue 0 to "n-1"
while "empty"=="empty"
{
queue #"n-2"+#"n-1" to "main"
output from "main"
for #"n-2"+#"n-1" do
{
queue 0 to "n"
}
transfer "n-2" to "garbage"
transfer "n-1" to "n-2"
transfer "n" to "n-1"
}