Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This program mine a X by X square
- function minage(x)
- for i = 1,2*x,1 do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- end
- function minage2(x)
- for i = 1,2*x,1 do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- end
- function LR(x)
- for i = 1,x,1 do
- minage2(x)
- minage(x)
- if turtle.getFuelLevel() <= 2*x then turtle.refuel() end
- end
- end
- function RL(x)
- for i = 1,x,1 do
- minage(x)
- minage2(x)
- if turtle.getFuelLevel() <= 2*x then turtle.refuel() end
- end
- end
- function depart()
- print("Don't forget to put fuel in 1st slot for the turtle before running this program")
- io.read()
- print("\nWich way would you like to dig first ? R / L")
- s = io.read()
- print("\nNumber of lines to dig")
- x = io.read("Range a creuser")
- math.floor(x/2)
- if s == "R" then
- RL(x)
- end
- if s == "L" then
- LR(x)
- else
- depart()
- end
- end
- depart()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement