yzrhnd

Untitled

Oct 26th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. -- 逆ピラミッド
  2.  
  3. local num = 8
  4.  
  5. local lnum=0
  6. for j=0,2*num-1 do
  7. local nn = 0
  8. lnum =10000000
  9. for i = 1,num do
  10. y = ((num - j)^2) + (i^2) - (num ^ 2)
  11. y= math.abs(y)
  12. if y <= lnum then
  13. lnum = y
  14. nn = i
  15. end
  16.  
  17. end
  18.  
  19. for i = 1,num do
  20. turtle.up()
  21. if i == nn then
  22. turtle.placeDown()
  23. end
  24. end
  25. turtle.forward()
  26. for i = 1,num do
  27. turtle.down()
  28. end
  29.  
  30. end
Advertisement
Add Comment
Please, Sign In to add comment