Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mydig()
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- end
- function mydigdown()
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- end
- function fuelcheck()
- if turtle.getFuelLevel() < 1 then
- turtle.refuel()
- end
- end
- function strip(y,rightshift)
- -- From center dig to y
- for i=0,y do
- mydig()
- end
- for i=0,y do
- turtle.back()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i=0,y do
- mydig()
- end
- for i=0,y do
- turtle.back()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- if( rightshift ) then
- turtle.turnRight()
- mydig()
- turtle.turnLeft()
- end
- end
- function octet ( radius )
- x = 0
- y = radius
- p = 1 - radius
- i = 0
- lower_octet = {}
- while( x < y ) do
- if( p < 0 ) then
- p = p + (2*x+2) + 1
- x = x + 1
- else
- p = p + (2*x+2) + 1 - (2*y-2)
- x = x + 1
- y = y - 1
- end
- print("(" .. x .. "," .. y .. ")")
- strip(y, false)
- lower_octet[i] = { y, x }
- i = i+1
- end
- print("-------");
- i = i - 1
- while( i >= 0 ) do
- print("(" .. lower_octet[i][1] .. "," .. lower_octet[i][2] .. ")")
- rightshift = true
- if( i== 0 ) then
- rightshift = false
- end
- strip(lower_octet[i][2], rightshift )
- i = i - 1
- end
- end
- radius = 6
- fuelcheck()
- octet( radius ) -- dig to the right
- turtle.turnLeft()
- for i=0,radius do
- turtle.forward()
- end
- turtle.turnLeft()
- octet( radius ) -- dig to the left
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement