Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = require'import'
- local t = turtle
- local long = tonumber(arg[1])
- local larg= tonumber(arg[2])
- local h = tonumber(arg[3])
- function fr(long, h)
- while long>1 do
- turtle.dig()
- while not t.forward() do t.dig() end
- if h>1 then
- turtle.digUp()
- end
- long = long-1
- end
- end
- function virage(turn, h)
- --0 turn left, 1 turn right
- if turn == 0 then
- turtle.turnLeft()
- turtle.dig()
- while not t.forward() do t.dig() end
- if h>1 then
- turtle.digUp()
- end
- turtle.turnLeft()
- turn = 1
- else
- turtle.turnRight()
- turtle.dig()
- while not t.forward() do t.dig() end
- if h>1 then
- turtle.digUp()
- end
- turtle.turnRight()
- turn = 0
- end
- return turn
- end
- local turn=1
- local nh=0
- turtle.dig()
- while not t.forward() do t.dig() end
- if h>1 then
- turtle.digUp()
- end
- repeat
- print(h)
- if nh==0 then
- nh= nh+1
- else
- if h>1 then
- turtle.digUp()
- turtle.up()
- h = h-1
- end
- if h>1 then
- turtle.digUp()
- turtle.up()
- h = h-1
- end
- if h>1 then t.digUp() end
- end
- l = 0
- nh2 = 0
- while l<larg do
- if nh2==0 then
- nh2=nh2+1
- else
- turn = virage(turn, h)
- end
- tool.needR()
- fr(long, h)
- l =l+1
- end
- turtle.turnLeft()
- turtle.turnLeft()
- until h<=2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement