Guest User

Untitled

a guest
Dec 10th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. until tostring(mines) == answer2
  2. print ("doneee!!!")
  3. end
  4.  
  5. function intro()
  6. print ("hello, how long would you like the tunnel to be?")
  7. answer = read()
  8. print ("how many strips?")
  9. answer2 = read()
  10. print ("starting...")
  11. end
  12.  
  13. function strips()
  14. repeat
  15. dig()
  16. distance = distance + 1
  17. until tostring(distance) == answer
  18. turnBack()
  19. next()
  20. end
  21.  
  22. function dig()
  23. if turtle.detect == true then
  24. turtle.dig()
  25. else
  26. turtle.forward()
  27. if turtle.detectUp == true then
  28. turtle.digUp()
  29. else
  30. turtle.forward
  31. end
  32. end
  33.  
  34. function next()
  35. turtle.turnRight()
  36. if turtle.detect() == true then
  37. turtle.dig()
  38. else
  39. turtle.forward()
  40. end
  41. if turtle.detectUp() == true then
  42. turtle.digUp()
  43. else
  44. turtle.forward()
  45. turtle.turnRight()
  46. end
  47. end
  48.  
  49. function turnBack()
  50. turtle.turnRight()
  51. turtle.turnRight()
  52. repeat
  53. turtle.forward()
  54. until tostring(distance) == distance - answer
  55. end
  56.  
  57. intro()
  58. mine()
Advertisement
Add Comment
Please, Sign In to add comment