Advertisement
Scalpweb

Untitled

Feb 11th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. shell.run("clear")
  2.  
  3. print("Combien de bloc de profondeur ?")
  4. depth = io.read()
  5.  
  6. print("Combien de bloc de large ?")
  7. width = io.read()
  8.  
  9. print("Combien de bloc de haut ?")
  10. height = io.read()
  11.  
  12. currentD = 0;
  13.  
  14. while currentD < depth do
  15.  
  16. if turtle.detect() then
  17. turtle.dig()
  18. end
  19. turtle.forward()
  20. turtle.turnRight()
  21.  
  22. currentH = 0;
  23.  
  24. while currentH < height do
  25.  
  26. currentW = 0
  27.  
  28. while currentW < width do
  29.  
  30. if turtle.detect() then
  31. turtle.dig()
  32. end
  33. turtle.forward();
  34.  
  35. currentW = currentW + 1
  36. end
  37.  
  38. turtle.turnRight()
  39. turtle.turnRight()
  40.  
  41. while currentW > 0 do
  42.  
  43. if turtle.detect() then
  44. turtle.dig()
  45. end
  46. turtle.forward();
  47.  
  48. currentW = currentW - 1
  49. end
  50.  
  51. if(currentH < height - 1)
  52. if turtle.detectDown() then
  53. turtle.digUp()
  54. end
  55. turtle.up()
  56. turtle.turnRight()
  57. turtle.turnRight()
  58. end
  59.  
  60. end
  61.  
  62. while currentH > 0 do
  63.  
  64. if turtle.detectDown() then
  65. turtle.digDown()
  66. end
  67. turtle.down();
  68.  
  69. currentH = currentH - 1
  70. end
  71.  
  72. turtle.turnLeft()
  73. currentD = currentD + 1
  74.  
  75. end
  76.  
  77. turtle.turnRight()
  78. turtle.turnRight()
  79.  
  80. while currentD > 0 do
  81.  
  82. if turtle.detect() then
  83. turtle.dig()
  84. end
  85. turtle.forward()
  86. currentD = currentD - 1
  87.  
  88. end
  89.  
  90. print("J'ai fini :)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement