用户:
花金柔查看:0 回复:0 评论:0 创建时间:2021-05-15T15:59:41
【作品展示】

【作品介绍】
此作品为纪念天问一号成功着陆火星
【作品源代码】
import turtle as t
import easygui as e
e.buttonbox('此作品为纪念2021年5月15日天问一号成功着陆火星', choices=['开始'])
C = e.buttonbox('您想要……', choices=['画长征五号运载火箭', '画天问一号卫星'])
t.hideturtle()
t.speed(0)
t.pensize(2)
if C == "画长征五号运载火箭":
#主体
t.up()
t.goto(-20,-50)
t.down()
t.setheading(90)
t.forward(200)
for a in range(10):
t.right(3)
t.forward(1)
for a in range(20):
t.forward(1)
t.right(120)
for a in range(20):
t.forward(1)
for a in range(10):
t.right(3)
t.forward(1)
t.forward(200)
t.right(90)
t.forward(25)
#推进器1
t.up()
t.goto(5,50)
t.setheading(-40)
t.down()
for a in range(20):
t.forward(1)
for a in range(10):
t.right(3)
t.forward(1)
t.setheading(-90)
t.forward(100)
t.setheading(180)
t.forward(25)
t.right(90)
t.forward(20)
#推进器1(附加
t.up()
t.goto(25,-40)
t.down()
t.setheading(-45)
t.forward(30)
t.setheading(-90)
t.forward(10)
t.right(90)
t.forward(25)
#推进器2
t.up()
t.goto(-20, 50)
t.setheading(-130)
t.down()
for a in range(20):
t.forward(1)
for a in range(10):
t.left(3)
t.forward(1)
t.setheading(-90)
t.forward(97)
t.setheading(0)
t.forward(25)
t.left(90)
t.forward(20)
#推进器2(附加
t.up()
t.goto(-38,-40)
t.down()
t.setheading(-135)
t.forward(30)
t.setheading(-90)
t.forward(10)
t.left(90)
t.forward(25)
#附加
t.up()
t.goto(-13,100)
t.color('blue')
t.down()
t.write('中', font = ('黑体', 10, 'bold'))
t.up()
t.sety((t.ycor() - 15))
t.down()
t.write('国', font = ('黑体', 10, 'bold'))
t.up()
t.sety((t.ycor() - 15))
t.down()
t.write('航', font = ('黑体', 10, 'bold'))
t.up()
t.sety((t.ycor() - 15))
t.down()
t.write('天', font = ('黑体', 10, 'bold'))
elif C == '画天问一号卫星':
#主体
t.color('#ff9900','#ff9900')
t.up()
t.goto(0,40)
t.down()
t.setheading(180)
t.begin_fill()
t.circle(20,150)
t.setheading(155)
t.forward(30)
t.right(90)
t.forward(30)
t.right(70)
t.forward(30)
t.end_fill()
t.up()
t.goto(0,0)
t.down()
t.setheading(0)
t.color('#c0c0c0','#cccccc')
t.begin_fill()
t.circle(20)
t.end_fill()
#太阳能板
t.up()
t.goto(-25,28)
t.color('blue')
t.down()
t.setheading(165)
t.forward(50)
t.up()
t.goto(48,5)
t.down()
t.forward(30)
#通讯器
t.up()
t.goto(-5,0)
t.color('#c0c0c0','#cccccc')
t.setheading(-100)
t.down()
t.begin_fill()
t.forward(5)
t.right(90)
t.circle(10,90)
t.left(90)
t.forward(20)
t.left(90)
t.circle(10,180)
t.end_fill()
t.done()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn