Major_Tuvok

Untitled

Aug 15th, 2016
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. shell.run("clear")
  2. print ("@Version: 1_1_1a")
  3. print ("@author: Kevin Iselborn")
  4. sleep (2)
  5.  
  6. width = 1
  7. length = 1
  8.  
  9.  
  10. function digAndForward()
  11. turtle.dig()
  12. turtle.forward()
  13. end
  14.  
  15. function getInput ()
  16. shell.run("clear")
  17. print ("Wie viele Reihen sollen abgebaut werden?")
  18. width = read()
  19. while not tonumber(width) do
  20. print ("Du darfst nur Zahlen eingeben...Bitte versuche es erneut.")
  21. print ("Wie viele Reihen sollen abgebaut werden?")
  22. width = read()
  23. end
  24. shell.run("clear")
  25. print ("Wie Lang sind diese Reihen?")
  26. length = read()
  27. while not tonumber(length) do
  28. print ("Du darfst nur Zahlen eingeben...Bitte versuche es erneut.")
  29. print ("Wie Lang sind diese Reihen?")
  30. length = read()
  31. end
  32. shell.run("clear")
  33. end
  34.  
  35. function mineRow ()
  36. i = 0
  37. while i<length do
  38. digAndForward()
  39. i=i+1
  40. end
  41. end
  42.  
  43. function changeRow ()
  44. turtle.turnRight()
  45. turtle.turnRight()
  46. mineRow()
  47. turtle.turnLeft()
  48. digAndForward()
  49. turtle.turnLeft()
  50. end
  51.  
  52. function mine ()
  53. k=0
  54. while k<width do
  55. mineRow()
  56. changeRow()
  57. k=k+1
  58. end
  59. end
  60.  
  61. getInput()
  62. mine()
  63.  
  64. print("finished")
Add Comment
Please, Sign In to add comment