Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Temporary refuel
- turtle.refuel()
- level = 1 -- Current level 1 - 9
- row = 1 -- Current row 1 - 5
- block = 1 -- Current Block 1 - 5
- direction = 1 -- For orientation
- ----- Movement functions ---------
- function forward()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- function turnLeft()
- turtle.turnLeft()
- forward()
- turtle.turnLeft()
- end
- function turnRight()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- end
- function goDown()
- while not turtle.down() do
- turtle.digDown()
- end
- if level == 1 or 3 or 5 or 7 or 9 then
- turtle.turnRight()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.turnLeft()
- end
- row = 1
- level = level + 1
- end
- -------------------------------
- function platform()
- for row = 1,4 do
- digLine()
- orientation()
- end
- if level < 9 and row == 5 then
- digLine()
- goDown()
- end
- end
- function orientation()
- if direction == 1 then
- turnRight()
- direction = 0
- elseif direction == 0 then
- turnLeft()
- direction = 1
- end
- end
- function digLine()
- while block <= 5 do
- forward()
- block = block + 1
- end
- block = 1
- row = row + 1
- end
- function initial()
- repeat
- platform()
- until level >= 9
- shell.run("info.lua")
- end
- initial()
Advertisement
Add Comment
Please, Sign In to add comment