Syntax and execution
A Rotpai program is a list of ordered pairs of characters:
ah ba bd fg
Each line of the program is independent of every other line unless the last character of the last pair of it is "." (without the "), then the line wuth this propertie and the next line are coinsidered to be just one line:
is the same as:
At each step of the program, to generate the next state, the interpreter goes through this proces for each pair:
- If the pair doesnt match in any of its ends to the adjasent pairs, it is rotated (ab ca cd => ab ac cd)
- If the pair matches in one of its ends, its changed which the pair at thet end (ab ac cd => ab cd ac)
- If the pair matches on bought of its ends, do nothing to it (ab bc cd => ab bc cd)
An end towching the adge is coinsidered to always match.
The program halts when none of the pairs can be rotated.
Rotpai's computational class is unclear, but it is most likely a finite state automaton.