Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function digBlocks(blocks)
- for i = 1, blocks do
- turtle.dig()
- turtle.forward()
- end
- end
- local function digLayers(length, width, depth)
- length = length - 1
- local turnDirection = "right"
- for i = 1, depth do
- print(i .. '/' .. depth .. " layers")
- for j = 1, width do
- digBlocks(length)
- if turnDirection == "right" and j < width then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- turnDirection = "left"
- elseif turnDirection == "left" and j < width then
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turnDirection = "right"
- end
- end
- if i < depth then
- turtle.turnRight()
- turtle.turnRight()
- turtle.digDown()
- turtle.down()
- end
- end
- end
- local function main()
- digLayers(3, 3, 6)
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement