Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = {...}
- direction = tArgs[1]
- if direction == 0 then
- if currentFacing == 1 then
- shell.run('TurnLeft',(1))
- elseif currentFacing == 2 then
- shell.run('TurnRight',(2))
- elseif currentFacing == 3 then
- shell.run('TurnRight',(1))
- end
- elseif direction == 1 then
- if currentFacing == 2 then
- shell.run('TurnLeft',(1))
- elseif currentFacing == 3 then
- shell.run('TurnRight',(2))
- elseif currentFacing == 0 then
- shell.run('TurnRight',(1))
- end
- elseif direction == 2 then
- if currentFacing == 3 then
- shell.run('TurnLeft',(1))
- elseif currentFacing == 0 then
- shell.run('TurnRight',(2))
- elseif currentFacing == 1 then
- shell.run('TurnRight',(1))
- end
- else -- direction 3
- if currentFacing == 0 then
- shell.run('TurnLeft',(1))
- elseif currentFacing == 1 then
- shell.run('TurnRight',(2))
- elseif currentFacing == 2 then
- shell.run('TurnRight',(1))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement