-
카테고리
-
세부 분야
프로그래밍 언어
-
해결 여부
미해결
로봇이 바라보는 방향
21.04.25 13:05 작성 조회수 176
0
로봇이 바라보는 방향을 어떻게 알아내나요?
답변을 작성해보세요.
0
Hojun Lee
지식공유자2021.04.27
안녕하세요.
북쪽을 바라보고 있는 것은 내장 함수로 구현이 되어 있어요. 따라서 아래와 같이 확인이 가능합니다.
print(facing_north())
다른쪽을 확인하는 것은 내장 함수로 구현이 되어 있지는 않지만,
아래와 같은 방법으로 사용하실 수 있습니다.
print(facing_north())
#Reeborg = UsedRobot(avenues=2, streets=2, orient_key='E', beepers=0, name='robot', colour='grey')
#Reeborg.set_trace_style(style=1, colour='sea green')
MyRobot = RefurbishedRobot(avenues=2, streets=2, orient_key='E', beepers=0, name='robot', colour='grey')
print(MyRobot.facing_east())
print(MyRobot.facing_south())
print(MyRobot.facing_west())
답변 1