Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dirTable = {{0, 1, 2, -1}, {-1, 0, 1, 2}, {2, -1, 0, 1}, {1, 2, -1, 0}}
- function faceDir(dir, from)
- turn = dirTable[from][dir]
- print(turn)
- if turn == 0 then
- return
- end
- if turn > 0 then
- for i=1,turn do turtle.turnRight() end
- else
- for i=1,turn do turtle.turnLeft() end
- end
- end
- faceDir(3, 0)
Add Comment
Please, Sign In to add comment