This commit is contained in:
Crispy 2025-05-22 20:51:25 +02:00
commit 12ffbdc45d
76 changed files with 79368 additions and 0 deletions

35
disk/0/pf2 Normal file
View file

@ -0,0 +1,35 @@
up = vector.new(0,1,0)
function greedystep(target)
--rednet.broadcast(position)
vec = target-position
if target == position then
return false
end
if vec.y > 0 then
if turtle.up() then
_G.position = position + up
return true
end
elseif vec.y < 0 then
if turtle.down() then
_G.position = position - up
return true
end
end
if vec:dot(facing) > 0 then
if turtle.forward() then
_G.position = position + facing
return true
end
end
if vec:dot(facing:cross(up)) > 0 then
turtle.turnRight()
_G.facing = facing:cross(up)
return true
else
turtle.turnLeft()
_G.facing = - facing:cross(up)
return true
end
end
return {greedystep = greedystep}