Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- write("Welcome to the Mining program.\n The Turtle will mine a prism that's to the left, forward, and below.\n GUI by Pdan4, code by David341.")
- write("Prism will begin after pressing enter after filling the DEPTH query.\n")
- local a
- local b
- local c
- write("\n \nBlocks forward? ")
- local length = read()
- write("\nBlocks left? ")
- local width = read()
- write("\nBlocks down? ")
- local depth = read()
- if depth%2 == 1 then
- c= 1
- else
- c=0
- end
- if length%2 == 1 then
- a= 0
- else
- a=1*c
- end
- if width%2 == 1 then
- b= 0
- else
- b=1*c
- end
- for d=1, depth do
- for w=1, width do
- turtle.dig()
- turtle.digDown()
- for l=2, length do
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- end
- if width-w>0 then
- if (w+a*b*c)%2>b then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- if (w+a*b*c)%2<=b then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- end
- end
- turtle.down()
- turtle.turnLeft()
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement