Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("longueur : ")
- local length = io.read()
- -- Function Definitions --
- local function digVerticalLine()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- os.sleep(0.5)
- end
- turtle.digDown()
- end
- local function turnAround()
- turtle.turnRight()
- turtle.turnRight()
- end
- local function checkForHoles()
- turtle.down()
- if not turtle.detectDown() then
- turtle.select(2)
- turtle.placeDown()
- end
- turtle.up()
- end
- local function digIntoWall()
- digVerticalLine()
- checkForHoles()
- turtle.turnLeft()
- digVerticalLine()
- checkForHoles()
- turnAround()
- turtle.forward()
- digVerticalLine()
- checkForHoles()
- turnAround()
- turtle.forward()
- turtle.turnRight()
- end
- -- Program --
- turtle.up()
- for i=0, length - 1 do
- digIntoWall()
- if i % 5 == 0 then
- turtle.select(1)
- turtle.placeDown()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement