AntiDupCall
Paradigm(s) | imperative |
---|---|
Designed by | User:Orisphera |
Appeared in | Category:2023:2023 |
Memory system | Stack-based |
Dimensions | one-dimensional |
Computational class | Turing complete |
Reference implementation | Unimplemented |
File extension(s) | {{{files}}} |
AntiDupCall is an esoteric programming language.
Specification
AntiDupCall has a stack of integer numbers that are at least -1 and the following commands:
Command | Description |
---|---|
<
|
Push a -1 onto the stack |
+
|
Increment the value at the top of the stack if the stack isn't empty |
[
|
Start a loop |
]
|
End a loop |
Each loop has its own integer value when the instruction pointer is inside it. When a loop is entered, its value is set to what it's convenient to set it to for the interpreter, most likely 1. At the start of each iteration, a value is popped from the stack and added to it. The loop runs while the stack is non-empty and its value is at least its value when entering the loop, but this is checked before popping the value, so if it becomes less that the value when entering the loop, it runs for one final iteration before proceeding to the code after it.
If the stack isn't empty when the program ends, it causes an error.
Examples
Infinite loop:
<+[<+]
Another infinite loop:
<<[+[<+]]
Empty the stack:
+[+]