Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = turtle
- function miF()
- if t.detect() then
- t.dig()
- end
- end
- function moF()
- if not t.detect() then
- t.forward()
- end
- end
- function mmF()
- miF()
- moF()
- end
- function miU()
- if t.detectUp() then
- t.digUp()
- end
- end
- function mm()
- mmF()
- miU()
- end
- function fu(num)
- t.refuel(num/40)
- end
- function go(num)
- while num > 0 do
- mm()
- num = num - 1
- if not t.detectDown() then
- t.placeDown()
- end
- end
- end
- function dis()
- num = io.read()
- num = tonumber(num)
- return num
- end
- function a()
- print("Input distance: ")
- num = dis()
- fu(num)
- go(num)
- t.turnLeft()
- t.turnLeft()
- go(num)
- end
- a()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement