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