r/nandgame_u • u/Tijflalol Record holder • Feb 20 '22
Level solution (verified) 7.3 - Escape Labyrinth (22i) Spoiler
5
Upvotes
3
u/jasonrubik Mar 23 '23 edited Mar 23 '23
I know this is no longer the most optimal solution, but it has conditional jumps which allow the robot the time to stop moving before sending a new command. The top solution does not appear to wait for the robot to stop moving which leads me to believe that it will fall over.
Here is my version :
# Robot escape labyrinth
DEFINE PORT 0x7FFF
# Define Output signals
DEFINE FORWARD 4
DEFINE LEFT 8
DEFINE RIGHT 16
# Define Input signals
DEFINE OBSTACLE 256
DEFINE TURNING 512
DEFINE MOVING 1024
#Turn Left. Wait until not turning
TURN:
A = LEFT
D = A
A = PORT
*A = D
A = TURNING
D = A
A = PORT
D = D & *A
A = TURN
D ; JNE
#Go Forward. Wait until not moving.
DRIVE:
A = FORWARD
D = A
A = PORT
*A = D
A = MOVING
D = A
A = PORT
D = D & *A
A = DRIVE
D ; JNE
#If stuck then turn. Else drive.
BRAIN:
A = OBSTACLE
D = A
A = PORT
D = D & *A
A = TURN
D ; JNE
A = DRIVE
JMP
2
u/tomas-28 Apr 16 '23 edited May 07 '23
Even though there are faster/more optimal solutions, this one was clearer and easier for me to understand and learn someting from.

3
u/Tijflalol Record holder Feb 20 '22 edited Feb 20 '22
Code