From 40ed219c1099b80b788d3ed3c1301317d84d4afd Mon Sep 17 00:00:00 2001 From: brulijam Date: Fri, 31 May 2024 22:03:07 +0000 Subject: [PATCH] Update src/main/programs/turtle-roomCreator.lua --- src/main/programs/turtle-roomCreator.lua | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/programs/turtle-roomCreator.lua b/src/main/programs/turtle-roomCreator.lua index 8cb3fc8..fb3c823 100644 --- a/src/main/programs/turtle-roomCreator.lua +++ b/src/main/programs/turtle-roomCreator.lua @@ -31,21 +31,26 @@ function excavate(depth, width, height) end end - -- Returning to the starting point of the layer + -- Returning to the starting point of the layer and going up if h < height then - -- Turning around - turtle.turnLeft() - turtle.turnLeft() - -- Going up one level - for i = 1, width do - turtle.forward() - end - -- Turning to the correct direction + -- Returning to the starting point if h % 2 == 0 then turtle.turnRight() + for i = 1, width - 1 do + turtle.forward() + end + turtle.turnRight() else turtle.turnLeft() + for i = 1, width - 1 do + turtle.forward() + end + turtle.turnLeft() end + + -- Going up + turtle.digUp() + turtle.up() end end end