Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------Tunneling Automaton - V2------
- ----Variables----
- t = turtle
- ----Basic Controls----
- function goForward()
- if t.detect() then
- t.digForward()
- t.forward()
- else
- t.forward()
- end
- end
- function goDown()
- if t.detectDown() then
- t.digDown()
- t.down()
- else
- t.down()
- end
- end
- function goUp()
- if t.detectUp() then
- t.digUp()
- t.up()
- else
- t.up()
- end
- end
- function refuel()
- t.select(1)
- t.refuel()
- end
- function length()
- num = io.read()
- num = tonumber(num)
- return num
- end
- ----Bridge----
- function layers()
- num = length()
- copynum = num
- while num > 0 do
- goDown()
- nut = 4
- while nut > 0 do
- goForward()
- goForward()
- t.turnLeft()
- nut = nut - 1
- end
- num = num - 1
- end
- goForward()
- t.turnLeft()
- goForward()
- while copynum > 0 do
- goUp()
- end
- end
- ----Main----
- function main()
- refuel()
- layers()
- end
- --Run--
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement