Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function diga()
- turtle.dig()
- turtle.digUp()
- turtle.digDown()
- end
- io.write('What length and width would you like your quarry to be?\n')
- local stepsLI = io.read()
- local stepsL = stepsLI
- local stepsWI = io.read()
- local stepsW = stepsWI
- local toTurn = stepsL - 1
- io.write('How many levels would you like to go?\n')
- local levelI = io.read() / 3
- local level = math.floor(levelI)
- local count = 0
- for f = 1, level, 1 do
- for g = 1, 2, 1 do
- turtle.digDown()
- turtle.down()
- end
- for h = 1, stepsL, 1 do
- for i = 1, stepsW - 1, 1 do
- while(turtle.detect() or turtle.detectUp() or turtle.detectDown()) do
- diga()
- end
- turtle.forward()
- end
- count = count + 1
- if(toTurn ~= 0) then
- if(count % 2 == 0) then
- turtle.turnLeft()
- if(turtle.detect() or turtle.detectUp() or turtle.detectDown()) then
- diga()
- end
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnRight()
- if(turtle.detect() or turtle.detectUp() or turtle.detectDown()) then
- diga()
- end
- turtle.forward()
- turtle.turnRight()
- end
- toTurn = toTurn - 1
- io.write(toTurn)
- end
- end
- turtle.digUp()
- if(count % 2 == 0) then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- turtle.digDown()
- turtle.down()
- stepsL = stepsLI
- stepsW = stepsWI
- toTurn = stepsL - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement