Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dig(width, height)
- local x = 0
- local y = 0
- while(y < height) do
- while(x < width - 1) do
- turtle.dig()
- turtle.forward()
- x = x + 1
- end
- turtle.digUp()
- turtle.up()
- turtle.turnLeft()
- turtle.turnLeft()
- y = y + 1
- x = 0
- end
- if(height % 2 > 0) then
- while(x > 0) do
- turtle.back()
- x = x - 1
- end
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- while(y > 0) do
- turtle.down()
- y = y - 1
- end
- end
- print("Height?")
- local height = tonumber(read())
- print("Width?")
- local width = tonumber(read())
- print("Length?")
- local length = tonumber(read())
- local z = 0
- turtle.turnRight()
- while(z < length) do
- dig(width, height)
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- z = z + 1
- end
Add Comment
Please, Sign In to add comment