Advertisement
Lukyrouge22

Untitled

Jun 1st, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. longueur = 0
  2. largeur = 0
  3. hauteur = 0
  4.  
  5. start_turn = 0
  6. function start()
  7. while turtle.detect() do
  8. turtle.turnLeft()
  9. start_turn = start_turn + 1
  10. calculer()
  11. end
  12. end
  13.  
  14. function prendre()
  15. while a < 17 do
  16. a = 1
  17. turtle.select(a)
  18. turtle.suck(64)
  19. end
  20. end
  21.  
  22. function partir()
  23. while start_turn ~= 0 do
  24. turtle.turnRight()
  25. if hauteur % 3 = 0 then
  26. turtle.up()
  27. end
  28. end
  29. end
  30.  
  31. function calculer()
  32. calc_l = longueur*2
  33. calc_la = largeur*2
  34. calc_h = hauteur/3
  35.  
  36. coal_1 = calc_l + calc_la + calc_h
  37. coal_t = coal_1/80
  38.  
  39. block_1 = longueur*hauteur*2
  40. block_2 = largeur*2*hauteur
  41. block_t = block_1+block_2
  42. end
  43. function graph()
  44. print("Block restants à placer : ", block_t)
  45. print("Fuel : ", coal_1, "Donc ", coal_t, " de coal")
  46. end
  47.  
  48. function place()
  49. if hauteur % 3 = 0 then
  50. turtle.place()
  51. turtle.placeUp()
  52. turtle.placeDown()
  53. end
  54. elseif hauteur % 2 = 0 then
  55. turtle.place()
  56. turtle.placeUp()
  57. end
  58. else
  59. turtle.place()
  60. end
  61. end
  62. start()
  63. while true do
  64. graph()
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement