Advertisement
Major_Tuvok

Untitled

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