Advertisement
Benn200022

Untitled

Apr 13th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. turtle.select(1)
  2. turtle.refuel()
  3.  
  4. turtle.select(2)
  5.  
  6. function buildTable2D(building)
  7. local moves = (#building * #building[1]) + (#building * 2)
  8. print("Das Konstrukt wird "..moves.." bewegungen benötigen - "..math.ceil(moves/80).." Kohle benötigt!")
  9.  
  10. local dir = false
  11. for i=#building, 1, -1 do
  12. dir = not dir
  13.  
  14. turtle.up()
  15. local line = building[i]
  16.  
  17. if dir then
  18. for i2=1, #line do
  19. if line[i2] == 1 then
  20. turtle.placeDown()
  21. end
  22. turtle.forward()
  23. end
  24. else
  25. for i2=#line, 1, -1 do
  26. if line[i2] == 1 then
  27. turtle.placeDown()
  28. end
  29. turtle.forward()
  30. end
  31. end
  32.  
  33. turtle.turnRight()
  34. turtle.turnRight()
  35. turtle.forward()
  36. end
  37. end
  38.  
  39.  
  40. buildTable2D(
  41. {
  42. {1,1,1,0,0,1,1,1,0,0,1,0,0,0,1},
  43. {1,0,0,1,0,1,0,0,0,1,0,1,0,1,0},
  44. {1,1,1,0,0,1,1,1,0,1,0,1,0,1,0},
  45. {1,0,0,1,0,1,0,0,0,1,0,1,0,1,0},
  46. {1,1,1,0,0,1,1,1,0,1,0,0,1,0,0},
  47. }
  48. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement