print(“How far is it”)
hanni = read()
addoreven = hanni % 2
tatehanni = hanni – 1
sleep(10)
houkou = 1
turtle.forward()
retu = 0
takasahanni = 0
while true do
turtle.digDown()
turtle.down()
for a = 1,hanni do
for b = 1,tatehanni do
turtle.dig()
turtle.forward()
sleep(0.1)
end
if retu ~= tatehanni then
if houkou == 1 then
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
houkou = 2
elseif houkou == 2 then
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
houkou = 1
end
retu = retu + 1
else
retu = 0
end
end
if addoreven == 1 then
turtle.turnLeft()
for c = 1,tatehanni do
turtle.back()
end
turtle.turnRight()
for d = 1,tatehanni do
turtle.back()
end
elseif addoreven == 0 then
turtle.turnRight()
for e = 1,tatehanni do
turtle.back()
end
turtle.turnRight()
houkou = 1
end
takasahanni = takasahanni + 1
for f = 1,takasahanni do
turtle.up()
end
turtle.back()
sleep(10)
turtle.forward()
for g = 1,takasahanni do
turtle.down()
end
end

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください