미로찾기 ì•Œê³ ë¦¬ì¦˜
ì‚�ì‚�ê°€ 있는곳ì�´ 출구로 ê°€ì •ë�œë‹¤.
단 ì‚�ì‚�는 미로ì�˜ 출구(즉 미로ì�˜ 외곽벽과 ì�¸ì ‘한 위치)ì—� 있어야만 한다.
ì‚�ì‚�ê°€ 있는곳ì�´ 출구로 ê°€ì •ë�œë‹¤.
단 ì‚�ì‚�는 미로ì�˜ 출구(즉 미로ì�˜ 외곽벽과 ì�¸ì ‘한 위치)ì—� 있어야만 한다.
def such():
ì €ë²ˆ 소트 ì•Œê³ ë¦¬ì¦˜ì�„ 한층 강화한 ê³ ì†� ì†ŒíŠ¸ì•Œê³ ë¦¬ì¦˜ì�´ë‹¤.
여러가지 환경ì—�서 테스트를 수행하였으며, ë¬¸ì œê°€ 있ì�„경우 조현태페ì�´ì§€ì—� ì˜¬ë ¤ë†“ìœ¼ë©´ ë¹ ë¥¸ì‹œì�¼ë‚´ì—� 해결하ë�„ë¡� ë…¸ë ¥í•˜ê² ìŠµë‹ˆë‹¤.
파ì�¼ì�„ copy/paste하는 ê³¼ì •ì—�서 중간중간ì—� 빈 줄ì�´ ìƒ�겼는ë�°, ì�¼ë¶€ ì‚ì œí•˜ì˜€ìœ¼ë‚˜ 남ì�€ 것ì�´ 있ì�„ 경우 ì§€ìš°ê³ ì‚¬ìš©í•´ì•¼ 합니다.(단 함수와 함수사ì�´ëŠ” 아닙니다.)
소트 함수명� sort()입니다.
ë¦¬íŽ™í† ë§�ì�´ ë�œë�œ ì�´ìœ 는 ë¦¬íŽ™í† ë§�ì�„ 하면 í• ìˆ˜ë¡� ëŠ�ë ¤ì§€ëŠ”ë“¯í•œ ë¬¸ì œê°€(ì�¸í„°í”„리터방ì‹�으로 ì�¸í•œë“¯)있는듯 하기때문 입니다.
while not next_to_a_beeper():
소트 ì•Œê³ ë¦¬ì¦˜if right_is_clear():
turn_right()
move()
else:move()
if front_is_clear():
move()
else:turn_left()
ì €ë²ˆ 소트 ì•Œê³ ë¦¬ì¦˜ì�„ 한층 강화한 ê³ ì†� ì†ŒíŠ¸ì•Œê³ ë¦¬ì¦˜ì�´ë‹¤.
여러가지 환경ì—�서 테스트를 수행하였으며, ë¬¸ì œê°€ 있ì�„경우 조현태페ì�´ì§€ì—� ì˜¬ë ¤ë†“ìœ¼ë©´ ë¹ ë¥¸ì‹œì�¼ë‚´ì—� 해결하ë�„ë¡� ë…¸ë ¥í•˜ê² ìŠµë‹ˆë‹¤.
파ì�¼ì�„ copy/paste하는 ê³¼ì •ì—�서 중간중간ì—� 빈 줄ì�´ ìƒ�겼는ë�°, ì�¼ë¶€ ì‚ì œí•˜ì˜€ìœ¼ë‚˜ 남ì�€ 것ì�´ 있ì�„ 경우 ì§€ìš°ê³ ì‚¬ìš©í•´ì•¼ 합니다.(단 함수와 함수사ì�´ëŠ” 아닙니다.)
소트 함수명� sort()입니다.
ë¦¬íŽ™í† ë§�ì�´ ë�œë�œ ì�´ìœ 는 ë¦¬íŽ™í† ë§�ì�„ 하면 í• ìˆ˜ë¡� ëŠ�ë ¤ì§€ëŠ”ë“¯í•œ ë¬¸ì œê°€(ì�¸í„°í”„리터방ì‹�으로 ì�¸í•œë“¯)있는듯 하기때문 입니다.
def sort_sub():
move()
if next_to_a_beeper():
def sort_sub_sub():if next_to_a_beeper():
pick_beeper()
turn_left()
turn_left()
while not next_to_a_beeper():
turn_left()
move()
put_beeper()
turn_left()
turn_left()
while not next_to_a_beeper():
move()
turn_left()turn_left()
move()
put_beeper()
while front_is_clear():
def gaedan():move()
if next_to_a_beeper():
if next_to_a_beeper():
pick_beeper()
turn_left()
move()
turn_left()
while not next_to_a_beeper():
move()
if right_is_clear():
break
turn_left()
move()
turn_left()
while not next_to_a_beeper():
move()
while next_to_a_beeper():if front_is_clear():
turn_left()move()
else:break
move()
if right_is_clear():
turn_left()
move()
else:move()
turn_left()
put_beeper()break
while next_to_a_beeper():
turn_left()
while not next_to_a_beeper():
if front_is_clear():
def move_endof_sub():if front_is_clear():
while front_is_clear():move()
else:break
sort_sub()
turn_left()turn_left()
while not next_to_a_beeper():
if front_is_clear():
while next_to_a_beeper():move()
else:turn_off()
if front_is_clear():
turn_left()move()
else:break
if front_is_clear():
move()
else:turn_off()
if right_is_clear():turn_left()
move()
else:move()
turn_left()
if not next_to_a_beeper():sort_sub_sub()
move_wall()
turn_right()
move()
turn_right()
while not next_to_a_beeper():
move()
turn_left()
def move_endof():turn_right()
move()
turn_right()
while not next_to_a_beeper():
move()
turn_right()move()
turn_left()
move_wall()
turn_left()
turn_left()
while not next_to_a_beeper():
def sort():turn_left()
turn_left()
while not next_to_a_beeper():
move()
while not next_to_a_beeper():
if right_is_clear():
while 1:
def turn_right(): move()
while next_to_a_beeper():if front_is_clear():
turn_left()move()
else:break
if right_is_clear():
turn_left()
move()
else:move()
turn_left()
move()while 1:
gaedan()
repeat(turn_left,3)
sort() 









