Advertisement
ecco7777

random moving turtle path placer

Nov 21st, 2015
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while true do
  2. r=math.random(1,10)
  3. x=0
  4. while x<=r do
  5. if turtle.detect()==false then
  6. turtle.back()
  7. turtle.place()
  8. sleep(0.2)
  9. else
  10. if turtle.detectDown()==true then
  11. turtle.up()
  12. end
  13. end
  14. x=x+1
  15. end
  16. r=math.random(0,2)
  17. x=0
  18. while x<=r do
  19. turtle.turnRight()
  20. x=x+1
  21. end
  22. if turtle.detectDown()==false then
  23. turtle.down()
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement