This commit is contained in:
Julian Brammer 2024-06-21 01:11:52 +02:00
parent e3a4a1322c
commit 1e29d967cf

View File

@ -21,6 +21,7 @@ end
--https://www.youtube.com/watch?v=bZe5J8SVCYQ --https://www.youtube.com/watch?v=bZe5J8SVCYQ
local function forward(x, y, z, r) local function forward(x, y, z, r)
if turtle.forward() then if turtle.forward() then
sleep(1)
if r == 0 then if r == 0 then
z = z + 1 z = z + 1
elseif r == 1 then elseif r == 1 then
@ -35,6 +36,7 @@ local function forward(x, y, z, r)
end end
local function back(x, y, z, r) local function back(x, y, z, r)
sleep(1)
if turtle.back() then if turtle.back() then
if r == 0 then if r == 0 then
z = z - 1 z = z - 1
@ -50,6 +52,7 @@ local function back(x, y, z, r)
end end
local function up(y) local function up(y)
sleep(1)
if turtle.up() then if turtle.up() then
y = y + 1 y = y + 1
end end
@ -57,6 +60,7 @@ local function up(y)
end end
local function down(y) local function down(y)
sleep(1)
if turtle.down() then if turtle.down() then
y = y - 1 y = y - 1
end end
@ -64,14 +68,18 @@ local function down(y)
end end
local function left(r) local function left(r)
turtle.turnLeft() sleep(1)
if turtle.turnLeft() then
r = (r-1) % 4 r = (r-1) % 4
end
return r return r
end end
local function right(r) local function right(r)
turtle.turnRight() sleep(1)
if turtle.turnRight() then
r = (r+1) % 4 r = (r+1) % 4
end
return r return r
end end