Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. function digForward(weite)
  2. for aktuelleweite = 0, weite, 1 do
  3. turtle.dig()
  4. turtle.forward()
  5. if turtle.detectDown() == false then
  6. turtle.select(1)
  7. turtle.placeDown()
  8. end
  9. end
  10. end
  11.  
  12.  
  13. function nextLineLeft()
  14. turtle.turnLeft()
  15. turtle.dig()
  16. turtle.forward()
  17. turtle.turnLeft()
  18. end
  19.  
  20. function nextLineRight()
  21. turtle.turnRight()
  22. turtle.dig()
  23. turtle.forward()
  24. turtle.turnRight()
  25. end
  26.  
  27. function getSize()
  28. write("Bitte gebe die Breite ein:")
  29. breite = io.read()
  30. write("Bitte gebe die Tiefe ein:")
  31. tiefe = io.read()
  32. write("Bitte gebe die Hoehe ein:")
  33. hoehe = io.read()
  34. end
  35.  
  36. function startMine()
  37. for i = 0, breite, 1 do
  38. digForward(tiefe)
  39. if i == 0 then
  40. nextLineLeft()
  41. end
  42. if i == 1 then
  43. nextLineRight()
  44. end
  45. if i > 1 then
  46. if i % 2 == 0 then
  47. nextLineLeft()
  48. end
  49. if i % 2 > 0 then
  50. nextLineRight()
  51. end
  52. end
  53. end
  54. end
  55.  
  56.  
  57.  
  58. function main()
  59. option = "n"
  60. getSize()
  61. print("Soll ein bereich von:")
  62. print("X: "..breite.." Z:"..tiefe.." Y:"..hoehe)
  63. write("ausgehoben werden? y/n")
  64. option = io.read()
  65.  
  66. if option == "y" then
  67. startMine()
  68. end
  69. end
  70.  
  71. breite = 0
  72. tiefe = 0
  73. hoehe = 0
  74.  
  75. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement