- Like Single Four, commands are referenced by numbers, but you can only use the digit 4.
- Data is manipulated on a queue, because doing math on a stack would be too easy.
- The two commands needed for Turing-completeness are assigned randomly.
The only allowed characters in a program are 4s and spaces. The program is parsed as a sequence of integers, which are run as commands. They operate on a queue of integers, which is initially empty.
||Dequeue a number and output its corresponding Unicode character.|
||Input a character and enqueue its Unicode value. EOF is -1.|
Almost any number not listed here enqueues itself. The exceptions are positive numbers which consist of two or more 4s. These enqueue the number with one less 4 than themselves:
44 enqueues 4,
444 enqueues 44, etc.
At the beginning of execution,
y are randomly assigned values between 7 and 99 inclusive. They are guaranteed to be different from each other and from 44.
Anything not defined above (dequeueing too many things, outputting a negative number, etc.) produces the error message
444 44 444 44 4 44 4 4 44 444 44444 444 4 4 4 4
444 44 444 44 - enqueue 44, 4, 44, and 4 4 44 - perform a division and enqueue another 4. Queue is now 44 4 11 4 4 4 - perform 2 more divisions. Queue is now 11 2 44 444 44444 444 - enqueue 4, 44, 4444, and 44 4 4 4 - perform 3 divisions. Queue is now 5 0 101 4 - execute the 5, which prints character 101: the letter 'e'
If the program can guess the values of
y, any ResPairate program can be translated to a sequence of commands. To translate each pair:
n m -> 2 y x (5n) m
To execute the program, manipulate the queue into the state
x 0 [program], then use the
4 command. To actually do this, programs would have to search through the possible
x,y pairs one by one, cleaning up after every pair that fails. The author has not tested this method in full detail, and it probably needs some modification to work (i.e. putting in code to help with cleanup that will be ignored by ResPairate). There might also be a better way to prove Turing-completeness.
--no-prng-...guarantees x=7 and y=8.
--any-ints-...allows any integers in the source code.
The full names of the options are long and randomly generated every time the interpreter is run, so as to discourage their use.