2D-Reverse
2D-Reverse is a esoteric programming language invented by User:Zzo38. It is a reversible programming language. There are 2 memory-spaces, which are 2D infinite in all directions, and the value of each is 2 integers, a horizontal value and vertical value (it can be represented by a ordered pair or a complex number), all values are starting at zero. Each memory space has its own pointer. There is also 1 program pointer that can be in one space in the program, and a direction (N, S, E, W). It starts at the $ and going east. The program pointer will wrap around the program area.
Commands
- \ or / = Program pointer reflects off of the mirror.
- 1 = Move first memory pointer in same direction as program pointer is moving.
- 2 = Move second memory pointer in same direction as program pointer is moving.
- $ = Program starts here.
- @ = Program can end here.
- s = Swap values at first memory pointer and second memory pointer.
- X = Acts as / if value at first memory pointer (both horizontal and vertical) is zero, or \ if is non-zero.
- + = Value at first memory pointer is adjusted 1 space by direction of program pointer. (Ex: (0,0) W = (-1,0) and (6,7) N = (6,8))
- = = Horizontal value of value at first memory pointer is XORed by horizontal value of value at second memory pointer.
- x = Acts as \ if horizontal value at first memory pointer is zero, or / if is non-zero.
- C = If program pointer east, then value at first memory pointer is rotated clockwise (as a complex number: multiply by -i), if program pointer west, then value at first memory pointer is rotated counter-clockwise (as a complex number: multiply by +i), if north or south then it does nothing.
- . or space = Does nothing.
- ; = Program pointer jumps to next command past next ; in same direction as it is moving. If there isn't any, then it wraps around the program area to the next ; command.
Examples
If value at pointer is (1,0) or (0,0), it will switch the value:
/+X+\ $X \..@ \.../
Move memory pointer right
$1@
Move memory pointer left
/.\ $\1\@ \./
Loop while not zero (put inside-loop code at * and extend the other lines with periods or spaces to match the length):
/.2*.\ = . $2s+s=X....x=2@ \..../
I believe this makes it Turing-complete.