Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function step()
- turtle.turnLeft()
- if not turtle.detect() then -- Check left
- storeTurn('L')
- else
- turtle.turnRight()
- if not turtle.detect() then -- Check forward
- storeTurn('F')
- else
- turtle.turnRight()
- if not turtle.detect() then -- Check right
- storeTurn('R')
- else
- turtle.turnRight()
- storeTurn('B')
- end
- end
- end
- turtle.forward()
- end
- function storeTurn(turn)
- print(turn)
- end
- while not rs.getInput('front') do
- step()
- end
- print('SOLVED!')
Advertisement
Add Comment
Please, Sign In to add comment