Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function turn(dir, times)
- times = times or 1
- for i = 1, times, 1 do
- if dir == "right" then
- turtle.turnRight()
- elseif dir == "left" then
- turtle.turnLeft()
- end
- end
- end
- function swapRowDir(currentDir)
- if currentDir == "right" then
- return "left"
- elseif currentDir == "left" then
- return "right"
- end
- end
- function swapColDir(currentDir)
- if currentDir == "up" then
- return "down"
- elseif currentDir == "down" then
- return "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