本文主要是介绍【Turtle系列】端正心态正确面对疫情,守护安全防线不放松,共抗疫情,只待春来~,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
前言
今年3月份,一场突如其来的“疫战”又一次打响。
在严峻的疫情之下,相信每个人也并未放松。面对疫情,足不出户,抗击疫情,不外出不聚
集,自觉为国家做贡献……宅在家要宅出健康,要宅出态度,宅出花样也要宅出精气神!接下来
跟小编一起为自己的家乡加油吧!
正文
这篇文章是绘制疫情期间,大家一起加油的画面!一方有难八方支援,全国人一起团结抗战,
只是绘制了部分的!
代码展示:
import turtle as t
import randomdef wheregoto(x,y): #x,y表示坐标t.up()t.goto(x,y)t.down()t.speed(0)
t.penize(4)
t.screensize(690,764) #设置画布
t.pensize(4)
wheregoto(-325,352)
t.setheading(270)
t.pencolor("gray1")
for j in range (2):t.forward(734)t.left(90)t.forward(650)t.left(90)
t.pencolor("red3")
t.penup()#枕头
t.speed(0)
t.fillcolor("mint cream")
t.setheading(180)
wheregoto(-86,-22)
t.begin_fill()
t.penown()
t.left(-10)
t.circle(160,12)
t.left(-41)
t.circle(60,10)
t.left(70)
t.circle(60,10)
t.left(40)
t.circle(200,8)
t.left(-8)
t.circle(200,4)
t.left(-18)
t.circle(200,4)
t.right(10)
t.circle(200,4)
t.left(10)
t.circle(200,4)
t.left(10)
t.circle(200,4)
t.left(10)
t.circle(200,3)
t.right(15)
t.circle(200,3)
t.right(25)
t.circle(200,3)
t.left(55)
t.circle(200,3)
t.left(25)
t.circle(200,14)
t.fd(150)
t.setheading(-5)
t.pendown()
t.circle(200,8)
t.right(40)
t.circle(200,2)
t.left(30)
t.circle(200,3)
t.left(20)
t.circle(200,2)
t.left(45)
t.circle(70,40)
t.right(30)
t.circle(200,17)
t.right(20)
t.circle(200,3)
t.left(10)
t.circle(200,3)
t.left(20)
t.circle(200,3)
t.left(20)
t.circle(60,3)
t.left(60)
t.circle(60,5)
t.left(20)
t.circle(60,5)
t.right(50)
t.circle(300,9)
t.seth(176)
t.fd(168)
t.end_fill()#杯子
t.setheading(0)
wheregoto(-100,90)
t.fillcolor("floral white")
t.begin_fill()
t.left(-80)
t.forward(160)
t.left(30)
t.circle(100,95)
t.left(35)
t.forward(163)
t.end_fill()
t.fillcolor("khaki1")
t.begin_fill()
t.left(57)
t.circle(150,85)
t.left(103)
t.circle(180,68)
t.end_fill()#面
#面底色
wheregoto(-86,81)
t.pencolor("red3")
t.fillcolor("khaki")
t.begin_fill()
t.setheading(56)
t.circle(-103,114)
t.pensize(2)
t.setheading(212)
t.circle(-154,70)
t.end_fill()#大面
wheregoto(-76,78)
t.pencolor("Darkgoldenrod3")
t.setheading(36)
t.pensize(4)
t.circle(-140,70)
wheregoto(-76,90)#面条1
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.pensize(4)
t.circle(-160,50)
wheregoto(-54,110)#2
t.pencolor("Darkgoldenrod3")
t.setheading(18)
t.pensize(4)
t.circle(-150,50)
wheregoto(-36,115)#3
t.pencolor("Darkgoldenrod3")
t.setheading(19)
t.pensize(4)
t.circle(-90,60)
wheregoto(-36,115)#4
t.pencolor("Darkgoldenrod3")
t.setheading(24)
t.pensize(4)
t.circle(-90,60)
wheregoto(-66,75)#5
t.pencolor("Darkgoldenrod3")
t.setheading(41)
t.circle(-90,90)
wheregoto(-10,103)#6
t.pencolor("Darkgoldenrod3")
t.setheading(0)
t.circle(-110,47)
wheregoto(-10,103)#7
t.pencolor("Darkgoldenrod3")
t.setheading(0)
t.circle(-150,37)#小面
t.pensize(5)
t.pencolor("red3")
wheregoto(-63,71)
t.setheading(39)
t.circle(-110,30)
t.setheading(10)
t.circle(-56,76)
wheregoto(-63,71)#面条1
t.pencolor("Darkgoldenrod3")
t.setheading(34)
t.circle(-110,30)
t.setheading(10)
t.circle(-56,72)
wheregoto(-54,67)#2
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.circle(-130,24)
t.setheading(6)
t.circle(-56,61)
wheregoto(-42,63)#3
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.circle(-130,20)
t.setheading(6)
t.circle(-56,52)
wheregoto(-28,60)#4
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.circle(-130,16)
t.setheading(6)
t.circle(-56,48)
wheregoto(-15,56)#5
t.pencolor("Darkgoldenrod3")
t.setheading(32)
t.circle(-130,14)
t.setheading(6)
t.circle(-40,48)
wheregoto(-1,56)#6
t.pencolor("Darkgoldenrod3")
t.setheading(34)
t.circle(-120,9)
t.setheading(6)
t.circle(-30,48)
wheregoto(13,56)#7
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.circle(-120,9)
t.setheading(6)
t.circle(-10,60)#面轮廓
wheregoto(-86,81)
t.pencolor("red3")
t.setheading(56)
t.circle(-103,114)
t.pensize(4)
t.setheading(212)
t.circle(-154,70)#酱汁
wheregoto(-34,110)
t.pensize(3)
t.pendown()
t.pencolor("orange4")
t.fillcolor("orange4")
t.begin_fill()
t.setheading(56)
t.circle(-40,50)
t.setheading(26)
t.circle(-40,70)
t.setheading(-15)
t.circle(-70,30)
t.circle(-30,30)
t.circle(-10,30)
t.circle(-10,100)
t.circle(-190,10)
t.circle(-5,360)
t.seth(-170)
t.circle(-180,20)
t.seth(145)
t.circle(-30,50)
t.end_fill()
t.penup()wheregoto(55,75)
t.begin_fill()
t.circle(3,360)
t.end_fill()wheregoto(40,90)
t.begin_fill()
t.circle(5,360)
t.end_fill()wheregoto(-45,95)
t.begin_fill()
t.circle(2,360)
t.end_fill()#葱
t.pencolor("lawn green")
t.fillcolor("lawn green")
wheregoto这篇关于【Turtle系列】端正心态正确面对疫情,守护安全防线不放松,共抗疫情,只待春来~的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!