Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Set parameters--------------------------------------------------------------
- rightFirst = TRUE
- lineDepth = 100
- nLines = 25
- --Define functions------------------------------------------------------------
- function digF()
- while turtle.detect() do
- turtle.dig()
- sleep(0.25)
- end
- end
- function digU()
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.25)
- end
- end
- function digD()
- while turtle.detectDown() do
- turtle.dig()
- sleep(0.25)
- end
- end
- --Begin run-------------------------------------------------------------------
- for i in 1, nlines do
- for j in 1, lineDepth do
- digF()
- turtle.forward()
- digU()
- digD()
- end
- if rightFirst then
- turtle.turnRight()
- digF()
- turtle.forward()
- digU()
- digD()
- turtle.turnRight()
- else
- digF()
- turtle.forward()
- digU()
- digD()
- turtle.turnRight()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement