Update src/main/programs/turtle-roomCreator.lua

This commit is contained in:
Julian Brammer 2024-05-31 22:09:38 +00:00
parent 96de9b2d6f
commit 567b4240c9

View File

@ -8,13 +8,18 @@ function excavate(depth, width, height)
end end
-- Return to starting position of each row -- Return to starting position of each row
if w < width then if w < width then
turtle.back(depth)
if w % 2 == 0 then
turtle.turnRight() turtle.turnRight()
turtle.turnRight() else
for d = 1, depth do turtle.turnLeft()
turtle.forward()
end end
turtle.forward()
if w % 2 == 0 then
turtle.turnRight() turtle.turnRight()
turtle.turnRight() else
turtle.turnLeft()
end
end end
end end
-- Go back to starting position of each layer and go up -- Go back to starting position of each layer and go up
@ -24,9 +29,7 @@ function excavate(depth, width, height)
else else
turtle.turnRight() turtle.turnRight()
end end
for w = 1, width - 1 do turtle.back(width * depth)
turtle.forward()
end
if h % 2 == 0 then if h % 2 == 0 then
turtle.turnLeft() turtle.turnLeft()
else else
@ -36,14 +39,7 @@ function excavate(depth, width, height)
end end
end end
-- Return to the starting position -- Return to the starting position
turtle.turnRight() turtle.back(height * width)
turtle.turnRight()
for h = 1, height - 1 do
turtle.down()
end
for w = 1, width - 1 do
turtle.forward()
end
turtle.turnRight() turtle.turnRight()
turtle.turnRight() turtle.turnRight()
end end