PLEASE
Explanation
There is only 1 command, assign. A place only has numbers. If anything is assigned to cell number 0, print the ASCII value out. Like:
2313132
A number has "+" before it. Like:
+1321
Instructions
commands | if the thing being assigned is a place | if the thing being assigned is a value |
---|---|---|
ASSIGN | assign place with value(dec)/place value. | See next table |
if the place value assigned recently equals to the first decimal number | Else |
---|---|
jump backward the number of the second decimal number commands | continue running |
Each statement is preceded by an optional line label (a number in brackets), followed by DO, or PLEASE. The politesse of a program's statement identifiers is checked to make sure it stays within certain limits (1/3 to 1/5 of the statements must be polite).
The language effectively has two commands:
// DO dest ASSIGN +value // DO dest ASSIGN value dest = value; recent = dest; // the recent variable is always assigned by this type of operation // DO +check ASSIGN +value // DO +check ASSIGN value if (recent == check) program_counter -= value;
The value
RHS will read the value of that place number, whereas +value
is a literal.
Turing-Completeness
Since PLEASE programs can only access a finite number of places/variables, and places can only take on values explicitly written in the program, PLEASE is at most in the class of finite state automata. Since it does have some memory, can infinitely loop, and can perform some conditional execution, it shouldn't be any lower than that class either.
Below is an incomplete translation from Brainfuck.
+
PLEASE 1 ASSIGN 0 DO 1 ASSIGN +1
-
DO 1 ASSIGN +1 PLEASE 1 ASSIGN +0
<
PLEASE 2 ASSIGN +0 DO 1 ASSIGN +0
>
DO 1 ASSIGN +0 PLEASE 2 ASSIGN +0