Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. function mydig()
  2. if turtle.detect() then
  3. turtle.dig()
  4. end
  5. turtle.forward()
  6. end
  7.  
  8. function mydigdown()
  9. if turtle.detectDown() then
  10. turtle.digDown()
  11. end
  12. turtle.down()
  13. end
  14.  
  15. function fuelcheck()
  16. if turtle.getFuelLevel() < 1 then
  17. turtle.refuel()
  18. end
  19. end
  20.  
  21. function strip(y)
  22. -- From center dig to y
  23. for i=0,y do
  24. mydig()
  25. end
  26. for i=0,y do
  27. turtle.back()
  28. end
  29. turtle.turnRight()
  30. mydig()
  31. turtle.turnLeft()
  32. end
  33.  
  34. function octet ( radius )
  35.  
  36. x = 0
  37. y = radius
  38. p = 1 - radius
  39.  
  40. i = 0
  41. lower_octet = {}
  42.  
  43. while( x < y ) do
  44.  
  45. if( p < 0 ) then
  46. p = p + (2*x+2) + 1
  47. x = x + 1
  48. else
  49. p = p + (2*x+2) + 1 - (2*y-2)
  50. x = x + 1
  51. y = y - 1
  52. end
  53.  
  54. print("(" .. x .. "," .. y .. ")")
  55. strip(y)
  56.  
  57. lower_octet[i] = { y, x }
  58. i = i+1
  59. end
  60. print("-------");
  61.  
  62. i = i - 1
  63.  
  64. while( i >= 0 ) do
  65. print("(" .. lower_octet[i][1] .. "," .. lower_octet[i][2] .. ")")
  66. strip(lower_octet[i][2])
  67. i = i - 1
  68. end
  69. end
  70.  
  71. radius = 6
  72. fuelcheck()
  73.  
  74. octet( radius )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement