ℕDQ
ℕDQ, or NDQ, is an extension of DQ that can simulate a minsky machine. It is also created by User:yayimhere.
memory
The memory is now stored in 2(!) stacks. These work like the registers.
additions
These commands have been added:
Symbol(s) | Meaning |
---|---|
$ |
Go to the other stack |
[]n |
Do the code in the brackets if the stack is not empty and continue. Else jump to line n. Lines are indexed in a one-based manner. |
U |
Halt |
Counterdistinguished from DQ, the program is not randomly executed.
turing-completeness proof
Here follows a translation from the Short Minsky Machine Notation to ℕDQ. It must use two registers and also when another register is needed for use the $
commands is used:
℘xy <-> [Q]x ℘y <-> 1 ℘ <-> U
Examples
The following example serves the endeictic purpose of presenting the conditional execution and line jumping: The first stack is extending from three to five elements by adminiculum of the second stack, ere the penultimate line skips the desinent one, immediately terminating the program without further modifications.
111$11 [Q$1$]6 [Q$1$]6 [Q$1$]6 1111111111
Interpreter
- Common Lisp implementation of the ℕDQ programming language. Please note that the concrete character set deployed constitutes a dependency on the Common Lisp implementation; in corollary, Unicode support may or may not be a feature incorporated in the personal environment. The interpreter at hand has been developed and tested with Steel Bank Common Lisp (SBCL) version 1.1.4 as part of the Lisp Cabinet 0.3.5 bundle.