Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. steps = {}
  2.  
  3. while (#steps <= 10) do
  4. movement = nil
  5.  
  6. if not turtle.detectDown() then
  7. movement = turtle.down()
  8. end
  9.  
  10. if movement == nil then
  11. if not turtle.detect() then
  12. movement = turtle.forward()
  13. elseif not turtle.detectUp() then
  14. movement = turtle.up()
  15. elseif not turtle.detectRight() then
  16. movement = turtle.turnRight()
  17. end
  18. end
  19.  
  20. print(movement)
  21. table.insert(steps, movement)
  22. movement()
  23. end
  24.  
  25. for (i = #steps, 1, -1) do
  26. steps[i]()
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement