yzrhnd

Untitled

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