xmann110

Untitled

Feb 14th, 2020
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function refuel()
  2. if turtle.getFuelLevel() < 10 then
  3. turtle.select(1)
  4. turtle.refuel(1)
  5. end
  6. end
  7.  
  8. args = {...}
  9. triangleSize = args[1]
  10.  
  11. print(triangleSize)
  12.  
  13. for height=1, triangleSize do
  14. refuel()
  15. if not (height == 1) then
  16. for x=1, (height * 2) - 1 do
  17. for y=1, (height * 2) - 1 do
  18. print(tostring(x) .. "," .. tostring(y))
  19. refuel()
  20. turtle.forward()
  21. end
  22. if (height + x) % 2 == 0 then turtle.turnRight() else turtle.turnLeft() end
  23. turtle.forward()
  24. if (height + x) % 2 == 0 then turtle.turnRight() else turtle.turnLeft() end
  25. end
  26. turtle.turnLeft()
  27. if ((1 + height) % 2) == 0 then turtle.turnRight() else turtle.turnLeft() end
  28. end
  29. turtle.digUp()
  30. turtle.up()
  31. turtle.forward()
  32. if height % 2 == 0 then turtle.turnRight() else turtle.turnLeft() end
  33. turtle.forward()
  34. if height % 2 == 0 then turtle.turnRight() else turtle.turnLeft() end
  35. if height >= 2 then
  36. break
  37. end
  38. end
RAW Paste Data