Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This = {
- x = 0,
- y = 0,
- z = 0,
- rotation = 0
- }
- function This.face (self, deg)
- if self.rotation == deg then
- return true
- else
- self.rotateRight(self)
- self.face(self, deg)
- end
- end
- function This.rotateRight (self)
- if turtle.turnLeft() == true then
- self.rotation = self.rotation - 1
- if self.rotation < 0 then
- self.rotation = 3
- end
- else
- return false
- end
- end
- function This.rotateRight (self)
- if turtle.turnRight() then
- self.rotation = self.rotation + 1
- if self.rotation > 3 then
- self.rotation = 0
- end
- else
- return false
- end
- end
- function This.move (self, x, y, z)
- return true
- end
- a = This
- a.face(a, 2)
- a.face(a, 1)
- a.face(a, 2)
- a.face(a, 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement