Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function turn(direction, times)
- times = times or 1
- for i = 1, times, 1 do
- if direction == "right" then
- turtle.turnRight()
- elseif direction == "left" then
- turtle.turnLeft()
- end
- end
- end
- function swapRowDirection(currentDir)
- if currentDir == "right" then
- currentDir = "left"
- else
- currentDir = "right"
- end
- end
- function swapColDirection(currentDir)
- if currentDir == "up" then
- currentDir = "down"
- else
- currentDir = "up"
- end
- end
- function sForward(times)
- times = times or 1
- for i = 1, times, 1 do
- if not turtle.forward() then
- return i - 1
- end
- end
- return times
- end
- function sUp(times)
- times = times or 1
- for i = 1, times, 1 do
- if not turtle.up() then
- return i - 1
- end
- end
- return times
- end
- function sDown(times)
- times = times or 1
- for i = 1, times, 1 do
- if not turtle.down() then
- return i - 1
- end
- end
- return times
- end
Advertisement
Add Comment
Please, Sign In to add comment