Advertisement
Melodicolt

Untitled

Aug 2nd, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. function moveAround()
  2. turtle.turnRight()
  3. if turtle.forward() then
  4. moveRight()
  5. else
  6. turtle.turnLeft()
  7. moveLeft()
  8. end
  9. end
  10.  
  11. function moveRight()
  12. turtle.turnRight()
  13. if turtle.forward() then
  14. if turtle.forward() then
  15. turtle.turnLeft()
  16. if turtle.forward() then
  17. turtle.turnRight()
  18. print("I moved around the tree.")
  19. move()
  20. else
  21. print("Couldn't go right, trying left...")
  22. turtle.turnLeft()
  23. turtle.forward()
  24. turtle.forward()
  25. turtle.turnRight()
  26. turtle.forward()
  27. turtle.turnRight()
  28. moveLeft()
  29. end
  30. else
  31. print("Couldn't go right, trying left...")
  32. turtle.turnLeft()
  33. turtle.turnLeft()
  34. turtle.forward()
  35. turtle.turnRight()
  36. turtle.forward()
  37. turtle.turnRight()
  38. moveLeft()
  39. end
  40. else
  41. print("Couldn't go right, trying left...")
  42. turtle.turnLeft()
  43. turtle.forward()
  44. turtle.turnRight()
  45. moveLeft()
  46. end
  47. end
  48.  
  49. function moveLeft()
  50. turtle.turnLeft()
  51. if turtle.forward() then
  52. turtle.turnRight()
  53. if turtle.forward() then
  54. if turtle.forward() then
  55. turtle.turnRight()
  56. if turtle.forward() then
  57. turtle.turnLeft()
  58. print("I moved around the tree.")
  59. move()
  60. else
  61. print("I'm seriously stuck, master...")
  62. end
  63. else
  64. print("I'm seriously stuck, master...")
  65. end
  66. else
  67. print("I'm seriously stuck, master...")
  68. end
  69. else
  70. print("I'm seriously stuck, master...")
  71. end
  72. end
  73.  
  74. moveAround()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement