Mine shafts

This commit is contained in:
Nathanaël Courant 2020-08-19 22:46:44 +02:00
parent c254339760
commit 500a0a7b9f

View file

@ -226,7 +226,21 @@ end
-- Mine a new shaft in front of the turtle -- Mine a new shaft in front of the turtle
function mine_shaft() function mine_shaft()
turn_abs(0)
while depth < SHAFT_DEPTH do
if turtle.detect() then
turtle.dig() turtle.dig()
end
move_forward()
end
turn_abs(2)
while depth > 0 do
if turtle.detect() then
turtle.dig()
end
move_forward()
end
turn_abs(0)
end end
-- Main function -- Main function