MrThoe

Random Hurdles

Sep 2nd, 2020
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. function start(){
  2. while(frontIsClear()){
  3. move();
  4. }
  5. jumpHurdle();
  6. }
  7.  
  8. function jumpHurdle(){
  9. turnLeft();
  10. move();
  11. turnRight();
  12. //HURDLE
  13. if(frontIsClear()){
  14. move();
  15. turnRight();
  16. move();
  17. turnLeft();
  18. start(); //RECURSION
  19. } else {
  20. //END
  21. turnRight();
  22. move();
  23. turnLeft();
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment