用户:
胡峻浩查看:0 回复:0 评论:0 创建时间:2022-12-25T17:34:18
【作品展示】

【作品介绍】
党旗
【作品源代码】
import turtle
per=5
x,y=-40*per,20*per
turtle.colormode(255)
turtle.tracer(0)
myScreen=turtle.Screen()
myScreen.setup(150*per,92.7*per)
myScreen.bgcolor(237,44,37)
myPen=turtle.Pen()
myPen.hideturtle()
def g(x1,y1):
global x,y
myPen.goto(x+(x1-15)*per,y+(17-y1)*per)
def pu():
myPen.pu()
def pd():
myPen.pd()
ax,ay,bx,by,cx,cy,dx,dy,ex,ey,fx,fy,gx,gy,hx,hy,ix,iy,jx,jy,kx,ky,mx,my,nx,ny,ox,oy,px,py,rx,ry,tx,ty,喵,vy,xx,xy,yx,yy,zx,zy=1,1,1,33,33,33,33,1,29,33,33,29,8.5,18.5,19.5,7.5,4,14,17,5,13.5,1,17,17,17,1,17,33,17,15,11,16.5,16.5,16.5,16.5,11,3.5,30.5,6,30,4,28
myPen.pencolor(253,207,48)
myPen.fillcolor(253,207,48)
myPen.begin_fill()
pu()
g(11,7)
pd()
g(fx,fy)
g(ex,ey)
g(7,11)
g(11,7)
myPen.end_fill()
#锤把
myPen.begin_fill()
pu()
g(15,3)
pd()
g(ix,iy)
g(gx,gy)
g(hx,hy)
g(15,3)
myPen.end_fill()
pu()
g(jx,jy)
myPen.seth(45)
myPen.pencolor(237,44,37)
myPen.fillcolor(237,44,37)
myPen.begin_fill()
myPen.circle(5.32*per)
myPen.end_fill()
#锤头
myPen.pencolor(253,207,48)
myPen.fillcolor(253,207,48)
myPen.begin_fill()
pu()
g(nx,ny)
myPen.seth(0)
pd()
myPen.circle(-16*per,180)
myPen.circle(-18*per,55)
g(4.5,22.5)
myPen.seth(-55)
myPen.circle(17*per,34)
myPen.circle(11*per,90)
myPen.circle(16.5*per,90)
myPen.end_fill()
#镰刀
myPen.begin_fill()
myPen.pu()
myPen.seth(0)
g(3.5,33)
pd()
myPen.circle(2.5*per)
myPen.end_fill()
myPen.begin_fill()
pu()
g(yx,yy)
pd()
g(zx,zy)
g(5,27)
g(7,29)
g(yx,yy)
myPen.end_fill()
turtle.update()
turtle.done()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn