강의

멘토링

커뮤니티

Inflearn コミュニティ Q&A

a010563524062557 のプロフィール画像
a010563524062557

投稿した質問数

はじめてのコーディング - RUR-PLE (中等教育 - Python)

[チュートリアル] エージェントたちを管理できるプログラムを作ってください!

로봇이 바라보는 방향

作成

·

300

0

로봇이 바라보는 방향을 어떻게 알아내나요?

python

回答 1

0

Hojun Lee님의 프로필 이미지
Hojun Lee
インストラクター

안녕하세요.

북쪽을 바라보고 있는 것은 내장 함수로 구현이 되어 있어요. 따라서 아래와 같이 확인이 가능합니다.

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())
a010563524062557 のプロフィール画像
a010563524062557

投稿した質問数

質問する