Update src/main/programs/turtle-roomCreator.lua
This commit is contained in:
parent
96de9b2d6f
commit
567b4240c9
@ -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.turnRight()
|
turtle.back(depth)
|
||||||
turtle.turnRight()
|
if w % 2 == 0 then
|
||||||
for d = 1, depth do
|
turtle.turnRight()
|
||||||
turtle.forward()
|
else
|
||||||
|
turtle.turnLeft()
|
||||||
|
end
|
||||||
|
turtle.forward()
|
||||||
|
if w % 2 == 0 then
|
||||||
|
turtle.turnRight()
|
||||||
|
else
|
||||||
|
turtle.turnLeft()
|
||||||
end
|
end
|
||||||
turtle.turnRight()
|
|
||||||
turtle.turnRight()
|
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user