Mine: fix move

This commit is contained in:
Théophile Bastian 2020-08-18 18:38:51 +02:00
parent e806819475
commit fb47e96955

View file

@ -68,24 +68,28 @@ end
function go_to(dh, dd, ds)
go_to_depth(0)
while height > dh do
turtle.down()
height = height - 1
end
while height < dh do
turtle.up()
height = height + 1
if height ~= dh then
while height > dh do
turtle.down()
height = height - 1
end
while height < dh do
turtle.up()
height = height + 1
end
end
turn_abs(1)
if side ~= ds then
turn_abs(1)
while side > ds do
turtle.back()
side = side - 1
end
while side < ds do
turtle.forward()
side = side + 1
while side > ds do
turtle.back()
side = side - 1
end
while side < ds do
turtle.forward()
side = side + 1
end
end
go_to_depth(dd)
@ -135,7 +139,7 @@ function find_next_shaft()
while true do
print("Climb")
for hei=0,MAX_HEIGHT-1 do
for hei=1,MAX_HEIGHT-1 do
if (hei % 3) == 0 then
if turtle.detect() then
return