티스토리 뷰

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()

'Test > Python(20220101~)' 카테고리의 다른 글

Day7_Hangman Game2  (0) 2022.01.08
Day7_Hangman Game  (0) 2022.01.08
Day6_While loop  (0) 2022.01.07
Day6_Style Guide for Python Code  (0) 2022.01.07
Day5_비번 생성기  (0) 2022.01.06
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함