yzrhnd

Untitled

Oct 26th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. -- アーチ建設
  2.  
  3. local num = 16
  4.  
  5. local lnum=0
  6.  
  7. turtle.select(1)
  8.  
  9.  
  10. for k=1,8 do
  11. for j=0,2*num do
  12. local nn = 0
  13. lnum =10000000
  14. for i = 1,num do
  15. y = ((num - j)^2) + (i^2) - (num ^ 2)
  16. y= math.abs(y)
  17. if y <= lnum then
  18. lnum = y
  19. nn = i
  20. end
  21.  
  22. end
  23.  
  24. for i = 1,num do
  25. turtle.up()
  26. if i == nn then
  27.  
  28. if turtle.getItemCount() == 0 then
  29. selectNum = turtle.getSelectedSlot()
  30. if selectNum == 16 then
  31. selectNum = 0
  32. end
  33. turtle.select(selectNum+1)
  34. end
  35. turtle.placeDown()
  36. end
  37. end
  38. turtle.forward()
  39. for i = 1,num do
  40. turtle.down()
  41. end
  42.  
  43. end
  44.  
  45. turtle.turnRight()
  46. turtle.forward()
  47. turtle.turnLeft()
  48.  
  49. for i = 0,2*num do
  50. turtle.back()
  51. end
  52.  
  53. end
Advertisement
Add Comment
Please, Sign In to add comment