Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- startX, startY, startZ = gps.locate()
- function facingDirection()
- turtle.forward()
- currentX, currentY, currentZ = gps.locate()
- if currentX > startX then
- currentDirection = "east"
- end
- if currentX < startX then
- currentDirection = "west"
- end
- if currentZ > startZ then
- currentDirection = "south"
- end
- if currentZ < startZ then
- currentDirection = "north"
- end
- print("Facing: "..currentDirection)
- end
- facingDirection()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement