Compare commits
1 commit
5b107e3abe
...
3cb643761a
Author | SHA1 | Date | |
---|---|---|---|
Théophile Bastian | 3cb643761a |
|
@ -185,39 +185,34 @@ function find_next_shaft()
|
|||
go_to(next_shaft_height, 0, next_shaft_side)
|
||||
|
||||
while true do
|
||||
for hei=1,MAX_HEIGHT-1 do
|
||||
if side % 2 == 0 then
|
||||
while hei < MAX_HEIGHT - 1 do
|
||||
if is_shaft() then
|
||||
return
|
||||
end
|
||||
|
||||
if turtle.detectUp() then
|
||||
turtle.digUp()
|
||||
end
|
||||
move_up()
|
||||
end
|
||||
if is_shaft() then
|
||||
return
|
||||
end
|
||||
else
|
||||
while height > 0 do
|
||||
if is_shaft() then
|
||||
return
|
||||
end
|
||||
|
||||
if turtle.detectUp() then
|
||||
turtle.digUp()
|
||||
if turtle.detectDown() then
|
||||
turtle.digDown()
|
||||
end
|
||||
move_down()
|
||||
end
|
||||
move_up()
|
||||
end
|
||||
if is_shaft() then
|
||||
return
|
||||
end
|
||||
|
||||
turn_abs(1)
|
||||
if turtle.detect() then
|
||||
turtle.dig()
|
||||
end
|
||||
move_forward()
|
||||
turn_abs(0)
|
||||
|
||||
for hei=MAX_HEIGHT-1,1,-1 do
|
||||
if is_shaft() then
|
||||
return
|
||||
end
|
||||
|
||||
if turtle.detectDown() then
|
||||
turtle.digDown()
|
||||
end
|
||||
move_down()
|
||||
end
|
||||
if is_shaft() then
|
||||
return
|
||||
end
|
||||
|
||||
turn_abs(1)
|
||||
|
|
Loading…
Reference in a new issue