Compare commits

..

1 commit

Author SHA1 Message Date
Théophile Bastian 4853d3c729 Mine: write movement functions 2020-08-18 19:46:36 +02:00

View file

@ -70,25 +70,21 @@ function move_forward()
rc, desc = turtle.forward()
if not rc then abort("Move: "..desc) end
_count_move_dir(facing)
_dump_pos()
end
function move_back()
rc, desc = turtle.back()
if not rc then abort("Move: "..desc) end
_count_move_dir(facing + 2)
_dump_pos()
end
function move_up()
rc, desc = turtle.up()
if not rc then abort("Move: "..desc) end
height = height + 1
_dump_pos()
end
function move_down()
rc, desc = turtle.down()
if not rc then abort("Move: "..desc) end
height = height - 1
_dump_pos()
end
function go_to_depth(dd)
@ -235,7 +231,8 @@ function main()
while true do
print("Finding shaft")
find_next_shaft()
print("Mining shaft")
print("Mining shaft at position:")
_dump_pos()
mine_shaft()
print("Discharging")