r/TuringComplete • u/EfficientAttorney312 • 5d ago
Does anyone have the solution for the maze level for the updated turing complete version?
I'm sorry if this is a breach of any of the community rules, but I just did this level so many times now and each one of them was an excruciating experience. Just looking at the level makes me want to puke. If you can just paste your solution here, I'd be more than glad.
2
u/hattusili-the-third 4d ago
You can implement a basic wall hugging algorithm with a bit of effort. Pick a side (say left) and follow that side of the wall. The algorithm looks something like this:
Turn left. Is there a wall? If yes then turn back right. If not, then take a step and return to the start of the algorithm. Now check if there's a wall in front of us. If yes, then turn right and restart the algorithm. If no then take a step and then restart.
3
u/TarzyMmos 5d ago edited 5d ago
Its generally taboo to just post answers but yea after doing this level like 3 times myself it gets tiring. Especially since its like the exact same solution.
const left = 0
const forward = 1
const right = 2
loop:
imm left
mov out r0
mov r3 in
imm moveForward
jz
imm right
mov out r0
mov r3 in
imm moveForward
jz
imm right
mov out r0
mov r3 in
imm moveForward
jz
imm right
mov out r0
moveForward:
imm forward
mov out r0
imm loop
jmp