TEXT 19
Data Science Class Guest on 18th October 2022 10:53:35 AM
  1. Reeborg's World Hurdle 3:
  2. def jump():
  3.         turn_left()
  4.         if not wall_in_front():
  5.             move()
  6.         else:
  7.             turn_right()
  8.         turn_right()
  9.        
  10. def move_down():
  11.     turn_right()
  12.     move()
  13.  
  14. def turn_right():
  15.     turn_left()
  16.     turn_left()
  17.     turn_left()
  18.    
  19. def movecarefully():
  20.     if  wall_in_front():
  21.         jump()
  22.     elif not wall_in_front():
  23.         move()
  24. while not at_goal():
  25.     movecarefully()

Coding Base is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.