Skip to content

Instantly share code, notes, and snippets.

@801YutaKa108
Created April 9, 2020 04:34
Show Gist options
  • Save 801YutaKa108/93de981d56066aaa83d21dc98be2ba98 to your computer and use it in GitHub Desktop.
Save 801YutaKa108/93de981d56066aaa83d21dc98be2ba98 to your computer and use it in GitHub Desktop.
import turtle
# 絵画領域とタートルの作成
turtle.setup(width=300, height=300) # 絵画領域の作成
my_turtle = turtle.Turtle() # タートル
# タートルを移動
my_turtle.forward(100) # 100前進
my_turtle.setpos(0, -100) # (0, -100)に移動
my_turtle.penup() # 筆を上げる
my_turtle.forward(50) # 100前進
my_turtle.pendown() # 筆を下ろす
my_turtle.forward(-50) # 100前進
# タートルを回転
my_turtle.setheading(90) # 上を向く
my_turtle.forward(100) # 100前進
# 点を描く
my_turtle.dot(10, "red") # 赤丸を描く
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment