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
local function forward(x, y, z, r)
if turtle.forward() then
sleep(1)
if r == 0 then
z = z + 1
elseif r == 1 then
@ -35,6 +36,7 @@ local function forward(x, y, z, r)
end
local function back(x, y, z, r)
sleep(1)
if turtle.back() then
if r == 0 then
z = z - 1
@ -50,6 +52,7 @@ local function back(x, y, z, r)
end
local function up(y)
sleep(1)
if turtle.up() then
y = y + 1
end
@ -57,6 +60,7 @@ local function up(y)
end
local function down(y)
sleep(1)
if turtle.down() then
y = y - 1
end
@ -64,14 +68,18 @@ local function down(y)
end
local function left(r)
turtle.turnLeft()
r = (r-1) % 4
sleep(1)
if turtle.turnLeft() then
r = (r-1) % 4
end
return r
end
local function right(r)
turtle.turnRight()
r = (r+1) % 4
sleep(1)
if turtle.turnRight() then
r = (r+1) % 4
end
return r
end