Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = 0
- t = 0
- cyclet = 0
- cycles = 0
- print("x is "..x)
- print("t is "..t)
- print("cyclet is "..cyclet)
- print("cycles are "..cycles)
- function main()
- if x < 8 then
- while x < 8 do
- turtle.dig()
- turtle.forward()
- x = x + 1
- end
- end
- end
- function cycleCounter()
- if x == 8 then
- cycles = cycles + 1
- print(cycles)
- end
- end
- function turn()
- if x == 8 and cyclet == 0 then
- if t == 0 then
- while x == 8 do
- print("turn one")
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- x = 0
- t = 1
- end
- end
- end
- end
- function turnTwo()
- if x == 8 and cyclet == 0 then
- if t == 1 then
- while x == 8 do
- print("turn two")
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- x = 0
- t = 0
- end
- end
- end
- end
- function endCycle()
- if cycles == 8 then
- turtle.digDown()
- turtle.down()
- turtle.turnLeft()
- turtle.turnLeft()
- cycles = 0
- t = 0
- x = 0
- print("new cycle")
- if cyclet == 0 then
- cyclet = 1
- else
- cyclet = 0
- end
- end
- end
- function turnThree()
- if x == 8 and cyclet == 1 then
- if t == 0 then
- while x == 8 do
- print("turn three")
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- x = 0
- t = 1
- end
- end
- end
- end
- function turnFour()
- if x == 8 then and cyclet == 1 then
- if t == 1 then
- while x == 8 do
- print("turn four")
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- x = 0
- t = 0
- end
- end
- end
- end
- while true do
- main()
- cycleCounter()
- endCycle()
- turn()
- turnTwo()
- turnThree()
- turnFour()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement