Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ChkFuel()
- if turtle.getFuelLevel() == 0 then
- turtle.select(1)
- if turtle.refuel(1) == true then
- write('Dozapravke na ')
- write(x)
- write('x')
- print(y)
- end
- end
- end
- function Fwd(Int)
- a = 0
- while a < Int do
- turtle.dig()
- ChkFuel()
- turtle.forward()
- a = a + 1
- end
- end
- function Turn(Bool)
- if Bool == true then
- turtle.turnRight()
- Fwd(1)
- turtle.turnRight()
- return false
- else
- turtle.turnLeft()
- Fwd(1)
- turtle.turnLeft()
- return true
- end
- end
- function down()
- turtle.digDown()
- turtle.down()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- print('Vvedite Shiriny')
- mX = tonumber(read())
- print('Vvedite glubinu')
- mY = tonumber(read())
- x=0
- y=0
- Fwd(1)
- turtle.turnLeft()
- Fwd(mX/2)
- turtle.turnRight()
- for c=1, 3 do
- turtle.digUp()
- turtle.up()
- end
- turn = true
- while y < mY+3 do
- if y > 0 then
- down()
- end
- x = 0
- while x < mX do
- Fwd(mX)
- x = x + 1
- if x ~= mX then
- turn = Turn(turn)
- end
- end
- y = y + 1
- end
- for b=0, mY-1 do
- turtle.digUp()
- turtle.up()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement