yzrhnd

Untitled

Oct 31st, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. -- 逆ピラミッド
  2.  
  3. local num = 10
  4.  
  5. local lnum=0
  6.  
  7. turtle.select(1)
  8.  
  9. for i = 1,10 do
  10. turtle.up()
  11. end
  12.  
  13. -- ここから
  14.  
  15. for j =-1*num ,num do
  16. for i = -1*num,num do
  17.  
  18. if (j-0.5)^2 + (i-0.5)^2 > (j+0.5)^2 + (i+0.5)^2 then
  19. if (num)^2 <= (j-0.5)^2 + (i-0.5)^2 then
  20. if (num)^2 >= (j+0.5)^2 + (i+0.5)^2 then
  21. turtle.placeDown()
  22. end
  23. end
  24. else
  25. if (num)^2 >= (j-0.5)^2 + (i-0.5)^2 then
  26. if (num)^2 <= (j+0.5)^2 + (i+0.5)^2 then
  27. turtle.placeDown()
  28. end
  29. end
  30. end
  31.  
  32.  
  33. turtle.forward()
  34. end
  35.  
  36. for i = -1*num,num do
  37. turtle.back()
  38. end
  39.  
  40. turtle.turnRight()
  41. turtle.forward()
  42. turtle.turnLeft()
  43.  
  44. end
Advertisement
Add Comment
Please, Sign In to add comment