Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Direction = ""
- X = 0
- Y = 0
- function TurnLeft()
- turtle.turnLeft()
- if(Direction == "X") then Direction = "-Y" end
- if(Direction == "-X") then Direction = "Y" end
- if(Direction == "Y") then Direction = "X" end
- if(Direction == "-Y") then Direction = "-X" end
- end
- function TurnRight()
- turtle.turnRight()
- if(Direction == "X") then Direction = "Y" end
- if(Direction == "-X") then Direction = "-Y" end
- if(Direction == "Y") then Direction = "-X" end
- if(Direction == "-Y") then Direction = "X" end
- end
- function TurnBack()
- turtle.turnLeft()
- turtle.turnLeft()
- if(Direction == "X") then Direction = "-X" end
- if(Direction == "-X") then Direction = "X" end
- if(Direction == "Y") then Direction = "-Y" end
- if(Direction == "-Y") then Direction = "Y" end
- end
- function Forward()
- turtle.forward()
- if(Direction == "X") then X = X + 1 end
- if(Direction == "-X") then X = X - 1 end
- if(Direction == "Y") then Y = Y + 1 end
- if(Direction == "-Y") then Y = Y - 1 end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement