import turtle 로 화면을 띄운다.
한 줄씩 떼서보면,
import turtle as t
= turtle 이라는 모듈을 불러오고, turtle을 t로 정의해서 쓴다.
t.forward(움직이고 싶은 픽셀길이)
= 괄호 안에 넣은 숫자만큼 거북이가 움직인다.
t.right(방향을 틀고 싶은 픽셀길이)
= 괄호 안에 넣은 숫자만큼 거북이가 방향을 움직인다.
방향 함수들
해당 함수들은 아래 주소에서 가져왔다.
https://docs.python.org/3/library/turtle.html
turtle — Turtle graphics — Python 3.8.1 documentation
turtle — Turtle graphics Source code: Lib/turtle.py Introduction Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon in
docs.python.org
원문(원래길이)의 함수와 줄임말이다. 줄임말을 써도 파이썬에서 읽을 수 있다.
Turtle motionMove and draw
backward() | bk() | back()
goto() | setpos() | setposition()
turtle — Turtle graphics — Python 3.8.1 documentation
turtle — Turtle graphics Source code: Lib/turtle.py Introduction Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon in
docs.python.org
등등...