local x = 3
local y = 1
local z = 4
local fuel = 0
local Verbrauch = 0
-- function FuelCount()
-- if (Verbrauch > turtle.getFuelLevel()) then
-- write(tostring(Verbrauch))
-- write(" > ")
-- term.write(tostring(turtle.getFuelLevel()))
-- end
-- end
function VerbrauchErmitteln()
Verbrauch = 14.8571 * radius * radius - 10.0571 * radius + 12.2
end
function fforward()
while (turtle.forward() == false) do
fdig()
sleep(0.4)
end
fuel = fuel + 1
end
function fdigUp()
while(turtle.detectUp()) do
turtle.digUp()
sleep(0.4)
end
end
function fdig()
while(turtle.detect()) do
turtle.dig()
sleep(0.4)
end
end
function Reihe()
turtle.turnRight()
fdig()
fdigUp()
turtle.up()
fdig()
turtle.turnLeft()
turtle.turnLeft()
fdig()
turtle.down()
fdig()
turtle.turnRight()
turtle.digDown()
turtle.down()
turtle.turnRight()
fdig()
turtle.turnLeft()
turtle.turnLeft()
fdig()
turtle.turnRight()
turtle.up()
fuel = fuel + 4
end
function Block()
fforward()
for i = 1, x - 1 do
Reihe()
fforward()
end
Reihe()
turtle.back()
turtle.turnRight()
turtle.forward()
fuel = fuel + 2
end
print("Hallo Welt!")
term.write("Radius? ")
radius = tonumber(read())
VerbrauchErmitteln()
while (Verbrauch > turtle.getFuelLevel()) do
term.write("Radius? ")
radius = tonumber(read())
VerbrauchErmitteln()
end
Block()
while z < radius do
x = 3 * y
Block()
Block()
y = y + 1
z = z + 3
end
write("Verbrauchte Energie: ")
write(tostring(fuel))
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}