The code is a maze

From Esolang
Jump to navigation Jump to search

The code is a maze is a Zame-inspired esolang by User:Hammy

Execution

The program is a maze made out of characters that can be anything.

The first part of execution is the solving.

The "solver" will start solving the maze at the top-left corner facing right.

If it is looking at a wall that is 1 character away, it will turn right.

If it is at an intersection, it will check the path to the right side of the solver. If it is a dead end, or if it's another intersection with only dead ends, check the left path instead. If both didn't work, check the middle path. If all of them are dead ends, go to the previous intersection and try to solve it.

If the solver couldn't find the exit, then the program halts with the error "Malformed maze detected".

The next stage is the execution.

For every 2 steps the solver made, it maps to a BF command:

Steps (L for left, R for right, M for middle) BF commands
LL +
LR -
LM <
RL >
RR .
ML [
MR ]
MM NOP

Then the program is finished!

Examples

soon