Commit affc4e5e by BellCodeEditor

save project

parent bdb13d18
Showing with 38 additions and 0 deletions
import turtle
SCREEN_WIDTH = 400
SCREEN_HEIGHT = 300
SCREEN_BGCOLOR = "black"
PEN_COLOR = "white"
PEN_SIZE = 2
PEN_SPEED = 5
STARTX = 0
STARTY = 0
LENGTH = 200
ANGLE = 144
#准备纸 画在哪里
turtle.screensize(SCREEN_WIDTH,SCREEN_HEIGHT,SCREEN_BGCOLOR)
#准备笔 用什么画
pen = turtle.Pen()
pen.pencolor(PEN_COLOR)
pen.pensize(PEN_SIZE)
pen.speed(PEN_SPEED)
pen.shape("turtle")
#从哪里开始画 起始点
pen.penup()
pen.goto(STARTX,STARTY) #pen.setposition(x,y)
pen.pendown()
#开始作画
pen.fillcolor("yellow")
pen.begin_fill()
for times in range(0,5,1):
pen.forward(LENGTH)
pen.right(ANGLE)
pen.end_fill()
pen.hideturtle()
turtle.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment