Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --http://pastebin.com/Wh6zKyEC --
- --Variable tunnel--
- --Program name "Var"--
- print("Variable")
- print()
- --Refuels--
- for i=16,1,-1 do
- turtle.select(i)
- turtle.refuel()
- end
- fuel=turtle.getFuelLevel()
- --Asks for dimentions--
- print("Width?")
- width=read()
- print("Height?")
- height=read()
- print("Distance?")
- distance=read()
- --Calculates movements that will be carried out--
- --Number of moves that will be done--
- moves=0
- --Takes one movement to turn at the end of a width to get ready for the next--
- for p=width,0,-1 do
- moves=moves+1
- end
- --Takes "height" movement per "width" to break all the blocks--
- for k=height,0,-1 do
- moves=moves+(width*1)
- end
- if (fuel-(fuel%moves))/moves < 2 then
- MaxDistance=0
- else
- MaxDistance=(fuel-(fuel%(moves)))/(moves)
- end
- print("Starting tunnel with ",fuel," fuel")
- print("That equates to a ",MaxDistance, " long tunnel (Of size 3x3)")
- for y=width,1,-1 do
- for x=height,1,-1 do
- turtle.dig()
- cangoup=turtle.detectUp()
- turtle.up()
- end
- if cangoup==true then
- turtle.down()
- end
- turtle.turnRight()
- turtle.forward()
- furtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement