Test/Python(20220101~)

Day6_미로탈출

kiostory 2022. 1. 7. 22:29

 

 

def turn_right():
    turn_left()
    turn_left()
    turn_left()

def go_and_jump():
        while front_is_clear():
            if not at_goal():
                move()
            else:
                done()
        turn_left()
        while wall_on_right():
            move()
        turn_right()
        move()
        turn_right()
        while front_is_clear():
            move()
        turn_left()
        
while not at_goal():
    go_and_jump()

 

-------------------------------------------------------------------------------------------------------------------------------

 

 

def turn_right():
    turn_left()
    turn_left()
    turn_left()

def go_and_jump():
        turn_left()
        while wall_on_right():
            move()
        turn_right()
        move()
        turn_right()
        while front_is_clear():
            move()
        turn_left()
        
while not at_goal():
    if front_is_clear():
        move()
    else:
        go_and_jump()