用户:
小向X查看:0 回复:1 评论:0 创建时间:2023-05-27T16:09:06
【作品展示】

【作品介绍】
一个简单的画图
【作品源代码】
import turtle as t
def setPen(x, y):
t.penup()
t.goto(x, y)
t.pendown()
t.setheading(0)
#画圆函数
def drawCircle(r, color):
t.pencolor(color)
t.fillcolor(color)
setPen(0, 0-r)
t.begin_fill()
t.circle(r)
t.end_fill()
#画五角星函数
def drawFiveStars(r):
setPen(0, r)
t.right(72)
t.pencolor('white')
t.fillcolor("white")
t.begin_fill()
for i in range(5):
t.forward(228)
t.right(144)
t.end_fill()
drawCircle(240, 'red')
drawCircle(200, 'white')
drawCircle(160, 'red')
drawCircle(120, 'blue')
drawFiveStars(120)
t.done()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn