Reeborgs worls: Hurdle 4

Hurdles race

Reeborg has entered a hurdle race. Make him run the course, following the path shown.

The position, the height and the number of hurdles changes each time this world is reloaded.

What you need to know

You should be able to write programs that are valid for worlds Around 4 and Hurdles 3, and ot combine them for this last hurdles race.

Your program should also be valid for worlds Hurdles 1Hurdles 2 et Hurdles 3

Difficulty level

Background image: www.pexels.com


A robot located at (x, y) = (13, 1) carries no objects.

Goal to achieve:

The final position of the robot must be (x, y) = (13, 1) 


https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Hurdle%204&url=worlds%2Ftutorial_en%2Fhurdle4.json


def turn_right():

    turn_left()

    turn_left()

    turn_left()

def circular_movement():

    turn_left()

    move()

    turn_right()

    move()

    turn_right()

    move()

    turn_right()

    move()




def jump():

    #move()

    turn_left()

    count=0

    while wall_on_right()==1:

        move()

        count+=1

    turn_right()

    move()

    turn_right()

    while count!=0:

        move()

        count=count-1

    turn_left()

    

while at_goal()==0:

    if front_is_clear()==0:

        jump()

    

    else:

        move()

     

        


    

    

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings