如何画一只年兽(附代码及教程)

画年兽嘛,其实是一件特别费脑细胞而且特别麻烦的事——特别是在坐标、线段长度等参数还没有确定的情况下。本人冒着头发掉光的危险,画了一个年兽(???)(如下图)

快过年了,先给各位拜个早年~嘿嘿,祝看到这篇文章的各位身体平安,心想事成,万事如意噢~

好叻废话不多说,现在我就把做法分享给各位

1.首先导入turtle

from turtle import *
#或 import turtle

用from···import···是因为后期在编写程序的时候可以简写程序。

例如:turtle.fd()可以简写成fd()#forward可以简写成fd

2.设置左上角标题,屏幕长宽,画笔速度、宽度。然后隐藏画笔

title('年兽来咯~~~')#设置左上角标题为‘年兽来咯~~~’
screensize(1000,900,'red')#设置屏幕长,宽,颜色
speed(0)#设置画笔速度(最快为0)
pensize(5)#设置画笔的宽度
hideturtle()#隐藏画笔

接着我会将程序分成调用区和定义区(定义区在调用区上面)

3.设置函数“taibi”(为了方便抬笔,确定位置,再落笔)

def taibi(x,y):#def后跟函数名,括号内为变量up()#抬笔goto(x,y)#使画笔移动到横坐标为x,纵坐标为y的位置down()#落笔

由于程序重复用到这几个模块,所以我将它们整合为一个函数,方便调用及输出

(4.)此函数可设可不设,本人懒(bushi),想少敲几个字母(设置笔的颜色)

def yanse(a):pencolor(a)
#或用时直接就pencolor(),就不需要设置函数了

4.定义函数来画年兽的角

def jiao(f,g,h,j):fillcolor('coral4')#这个颜色在https://tool.oschina.net/commons?type=3有详细介绍begin_fill()right(95)#角的第一条线for i in range(1,131):fd(1)right(f)left(25)#调整画笔的角度#角的第二条线for i in range(1,46):fd(1)left(g)g += 0.1#角的第三条线for i in range(1,111):fd(1)right(h)#用if条件判断语句去在适当的时候调整画笔if i > 89:h += 0.03j += 1end_fill()
#调用如下
yanse('coral4')
taibi(-200,200)
jiao(-0.6,1.2,0.4,0)

 5.画年兽的头发,依然定义函数

def dingfa(k,l,m,c1,d1,e1,f1,h1,i1,j1,k1,a2,b2,a1,b1):fd(10)left(60)fd(55)for i in range(1,99):fd(l)right(k)k += 0.8if i > 10 and i <80:k = 0.8l = 0.5elif i>79:k = 0.5l = 1.1right(120)for i in range(1,76):fd(1)right(-0.6)left(25)for i in range(1,61):fd(1)left(m)m += 0.06right(40)for i in range(1,46):fd(1)right(0.3)right(120)left(50)for i in range(1,251):fd(c1)right(d1)   if d1 > 0.8:d1 -= 0.5        if i > 30 and i<161:d1 = 0.5if d1 > -0.6:d1 -= 0.3elif i > 160:d1 = -0.7c1 = 0.7right(125)for i in range(1,121):fd(e1)right(f1)if i > 109:f1 += 0.01left(170)for i in range(1,66):fd(h1)left(i1)right(160)for i in range(1,76):fd(j1)right(k1)if i > 46:j1 += 0.03right(80)for i in range(1,156):if i < 21:fd(a2)left(b2)elif i > 20 and i < 51:fd(a2 - 0.2)left(b2 + 0.8)elif i > 50 and i < 61:fd(a2 - 0.2)left(b2 + 0.9)elif i > 60 and i < 105:fd(a2 + 0.9)right(b2 - 0.2)elif i > 104:fd(a2 + 0.5)right(b2 + 0.31)right(130)for i in range(1,36):fd(a2)left(b2 - 0.15)right(45)for i in range(1,101):if i < 41:fd(a2)left(b2 - 0.05)elif i > 40:fd(a2 + 0.2)if i == 41:left(30)else:left(b2 - 0.3)left(155)for i in range(1,201):if i < 50:fd(a2)right(b2 - 0.15)elif i > 49 and i < 90:fd(a2 + 0.4)right(b2 + 0.8)elif i >89 and i < 106:fd(a2 + 0.5)left(b2 + 0.8)goto(-87,87)for i in range(1,41):if i == 1:right(20)fd(0.9)right(b1 - 0.7)if i > 15 and i < 26:right(0.2)elif i > 25:left(0.4)left(30)for i in range(1,16):fd(a1)right(b1)
#调用如下
taibi(-130,68)
yanse('chocolate1')
fillcolor('darkorange')
begin_fill()
dingfa(0.5,1.2,1.2,0.8,4,0.6,0.3,0.8,0.3,0.6,0.2,0.5,0.4,1,0.8)
end_fill()

6. 我们定义眉毛函数与眼睛,由于我画的黑眼珠是用dot画的,需要用眉毛来掩盖住一部分,所以我们先画眼睛再画眉毛(眉毛和眼睛各定义两个函数作区分)

def meimao1(e2):left(160)for i in range(1,6):fd(e2)left(90)e2 += 4#利用递增或递减来改变形状right(58)for i in range(1,11):if i < 11:fd(4)right(19)for i in range(1,91):fd(0.6)left(0.3)left(40)for i in range(1,71):fd(0.5)right(0.4 - 0.15)left(175)for i in range(1,76):  if i < 56:fd(1)right(1)else:fd(0.5 + 0.5)left(0.4 + 0.8)for i in range(47):fd(1)if i == 46:left(0.5)else:left(0.8)      
def meimao2(f2,g2,h2,i2):right(170)for i in range(1,6):fd(f2)right(90)f2 += 4f2 = 5left(70)for i in range(1,21):if i > 10:if i == 11:left(17)else:if i > 16:left(0.2)else:fd(f2 - 4)left(g2 + 0.4)else:fd(f2 - 3.5)for i in range(1,33):if i < 11:fd(f2 - 3)right(g2 + 0.2)g2 += 0.3if i < 16 and i > 10:fd(f2 - 3)right(g2 + 0.3)g2 += 0.65elif i > 15:fd(f2 - 1.5)right(g2 + 0.4)g2 -= 0.5right(175)for i in range(1,80):fd(i2)left(h2)if i > 69:if i == 70:h2 = 0.5i2 = 1.5else:h2 += 0.32else:h2 = 0.8i2 = 0.5for i in range(1,26):if i < 11:fd(f2 - 3.5)else:if i == 1:left(17)g2 = 0.4else:if i > 24:left(0.2)else:fd(f2 - 4)left(g2 + 0.4)for i in range(1,21):fd(1)right(1)
def yanjing1(j2,k2):right(20)for i in range(1,16):fd(0.7)right(0.8)for i in range(1,51):if i < 21:j2 += 1fd(0.1)right(j2)elif i > 20 and i < 38:if j2 > 0.4:j2 -= 1.6fd(k2 - 9)right(j2)k2 += 0.8left(100)fd(21)dot(20)fd(20)
def yanjing2(l1,l2,a3):left(138)for i in range(1,16):fd(0.6)left(1.2)for i in range(1,36):if i < 21:fd(0.9)left(l1)l1 += 0.2elif i > 20:fd(l2 + 0.1)left(a3 - 0.6)l2 += 0.18a3 += 0.19left(140)fd(29)dot(25)fd(28)
#调用如下
taibi(-80,26)
yanse('black')
fillcolor('white')
begin_fill()
yanjing2(0.5,1,1)
end_fill()
taibi(-87,39)
yanse('goldenrod1')
fillcolor('darkorange')
begin_fill()
meimao1(5)
end_fill()
taibi(-160,27)
yanse('black')
fillcolor('white')
begin_fill()
yanjing1(1,1)
end_fill()
taibi(-155,39)
yanse('goldenrod1')
fillcolor('darkorange')
begin_fill()
meimao2(5,0.4,0.5,1.2)
end_fill()

7.接着我们再画年兽两边的鬓发(我在这叫它侧发)

def cefa1(b3):right(17)fd(30)left(60)fd(10)left(120)fd(12)for i in range(1,26):fd(0.9)left(b3)b3 += 0.08
def cefa2(c3):for i in range(1,6):right(90)fd(c3)c3 += 8fd(20)right(12)for i in range(1,231):if i > 135:if i > 170:fd(1)right(0.2)else:fd(0.5)right(0.4)elif i > 105 and i < 136:fd(0.3)right(1.2)elif i > 95 and i < 106:fd(0.3)right(1.3)elif i > 50 and i < 95:fd(1.4)left(0.2)elif i < 51:fd(1)left(0.71)right(140)for i in range(1,146):if i > 105 and i < 146:fd(0.3)right(1.2)elif i > 95 and i < 106:fd(0.3)right(1.3)elif i > 50 and i < 95:fd(1.4)left(0.2)elif i < 51:fd(1)left(0.71)left(180)for i in range(1,41):fd(0.3)left(1.2)right(45)for i in range(1,21):fd(1)right(0.2)right(125)for i in range(1,31):fd(1)right(0.68)for i in range(1,46):fd(1)right(0.3)for i in range(1,81):fd(0.5)right(0.4)for i in range(1,108):fd(0.47)right(0.4)
#输出如下
taibi(-207,49)
yanse('goldenrod1')
fillcolor('darkorange')
begin_fill()
cefa1(1)
end_fill()
taibi(-38,22)
yanse('goldenrod1')
fillcolor('darkorange')
begin_fill()
cefa2(6.5)
end_fill()

8.画下巴鼻子和嘴巴(都定义在一个函数中)

def xbzbbz(d3,e3):left(78)for i in range(1,51):fd(0.9)right(0.5)for i in range(1,35):fd(1)right(0.4)for i in range(1,19):fd(d3)right(e3)e3 += 0.4d3 += 0.1taibi(-197,9)right(170)d3 = 0.4e3 = 1for i in range(1,83):if i > 45:d3 = 0.2e3 = 0.8fd(e3)left(d3) else:fd(e3)left(d3)d3 += 0.05e3 += 0.02taibi(-126,-28)left(48)yanse('#51150b')fillcolor('#51150b')begin_fill()for i in range(1,46):fd(0.8)left(0.8)left(90)for i in range(1,76):if i < 7:fd(0.7)left(1)elif i < 69 and i > 6:fd(0.5)left(0.2)else:fd(0.7)left(1)left(83)for i in range(1,46):fd(0.8)left(0.8)end_fill()taibi(-140,-42)yanse('chocolate1')right(4)fd(12)left(48)fd(30)left(58)fd(13)
#调用如下
taibi(-38,-2)
yanse('chocolate1')
xbzbbz(0.9,2.1)
taibi(-130,-64)

9.画脖子旁的鬓发(简称领发)

def lingfa1(f3,g3,h3):for i in range(1,5):left(90)fd(f3)f3 += 3left(78)fd(16)left(50)fd(5)right(60)fd(11)left(55)for i in range(1,26):if g3 < 1.63:fd(h3)right(1.3)else:fd(h3)right(g3)g3 -= 0.049h3 -= 0.025left(110)for i in range(1,84):fd(0.79)left(1.1)for i in range(1,71):fd(0.5)left(1)
def lingfa2(i3):for i in range(1,5):fd(i3)i3 += 3right(90)left(10)fd(9)right(45)fd(12)left(58)fd(12)right(53)for i in range(1,90):fd(0.9)left(0.5)right(9.8)fd(10)right(76)for i in range(1,98):fd(0.47)left(0.4)for i in range(1,71):fd(0.5)left(0.4)right(40)for i in range(1,31):fd(0.7)right(0.5)right(140)for i in range(1,131):if i > 105:fd(0.5)right(1.2)elif i > 50 and i < 106:fd(0.7)right(1)elif i < 51:fd(0.85)left(0.55)left(165)for i in range(1,31):fd(0.7)right(0.5)right(145)for i in range(1,89):fd(0.65)left(1.19)for i in range(1,91):fd(0.85)right(1.45)
#调用如下
taibi(-38,-2)
yanse('chocolate1')
xbzbbz(0.9,2.1)

10.画铃铛(再次使用dot函数去画圆)

def lingdang():dot(40,'darkorange1')#dot(直径,颜色(默认黑色))taibi(-133,-87)right(110)for i in range(1,48):fd(0.7)right(0.52)taibi(-133,-95)left(25)for i in range(1,51):fd(0.7)right(0.52)taibi(-113,-102)dot(9,'lightsalmon4')yanse('lightsalmon4')right(88)fd(12)
#调用如下
taibi(-115,-94)
yanse('firebrick2')
lingdang()

11.倒数第二步就是下半身了

def xiabanshen():fd(80)left(72)for i in range(1,51):fd(1)left(1.1)taibi(-90,-89)right(132)for i in range(1,86):fd(1)left(0.25)left(75)for i in range(1,48):fd(1.1)left(0.7)left(65)fd(63)taibi(-45,-135)right(80)fd(50)taibi(19,-90)right(142)for i in range(1,51):fd(1)left(1)right(15)fd(20)left(88)for i in range(1,61):fd(0.9)left(0.6)left(80)fd(12)left(70)fd(2)right(100)fd(2)for i in range(1,156):if i < 41:fd(0.99)right(0.4)elif i > 40 and i < 100:if i == 41:left(25)else:fd(1)left(1)elif i > 100:fd(0.7)left(0.3)
#调用如下
taibi(-136,-87)
yanse('chocolate1')
xiabanshen()

12.最后,就只剩尾巴咯

def weiba(l3,l4):right(130)for i in range(1,211):if i < 101:if i < 20:fd(0.8)right(1.1)else:fd(1)left(0.78)elif i < 111 and i > 100:if i == 101:left(90)fd(1)elif i == 110:fd(1)left(90)else:fd(1)else:if i > 190:fd(0.72)left(0.9)else:fd(1)right(0.9)taibi(130,0)left(146)begin_fill()for i in range(1,6):fd(l3)left(90)l3 += 3right(26)for i in range(1,201):if i < 81:fd(0.8)left(1)elif i < 101 and i > 80:if i == 81:right(32)fd(0.5)elif i == 100:left(66)else:fd(0.5)elif i < 121 and i > 100:if i == 120:fd(0.5)right(32)elif i == 101:left(66)else:fd(0.5)else:fd(0.8)left(1)right(26)for i in range(1,6):left(90)l4 -= 3fd(l4)end_fill()
#调用如下
taibi(55,-65)
yanse('goldenrod1')
weiba(5,20)

最后的最后,别忘了加上done()噢,否则程序一运行完就关闭咯

源代码如下:

from turtle import *
title('年兽来咯~~~')
screensize(1000,900,'red')
speed(0)
pensize(5)def taibi(x,y):up()goto(x,y)down()def yanse(a):pencolor(a)def jiao(f,g,h,j):fillcolor('coral4')begin_fill()right(95)for i in range(1,131):fd(1)right(f)left(25)for i in range(1,46):fd(1)left(g)g += 0.1for i in range(1,111):fd(1)right(h)if i > 89:h += 0.03j += 1end_fill()def dingfa(k,l,m,c1,d1,e1,f1,h1,i1,j1,k1,a2,b2,a1,b1):fd(10)left(60)fd(55)for i in range(1,99):fd(l)right(k)k += 0.8if i > 10 and i <80:k = 0.8l = 0.5elif i>79:k = 0.5l = 1.1right(120)for i in range(1,76):fd(1)right(-0.6)left(25)for i in range(1,61):fd(1)left(m)m += 0.06right(40)for i in range(1,46):fd(1)right(0.3)right(120)left(50)for i in range(1,251):fd(c1)right(d1)   if d1 > 0.8:d1 -= 0.5        if i > 30 and i<161:d1 = 0.5if d1 > -0.6:d1 -= 0.3elif i > 160:d1 = -0.7c1 = 0.7right(125)for i in range(1,121):fd(e1)right(f1)if i > 109:f1 += 0.01left(170)for i in range(1,66):fd(h1)left(i1)right(160)for i in range(1,76):fd(j1)right(k1)if i > 46:j1 += 0.03right(80)for i in range(1,156):if i < 21:fd(a2)left(b2)elif i > 20 and i < 51:fd(a2 - 0.2)left(b2 + 0.8)elif i > 50 and i < 61:fd(a2 - 0.2)left(b2 + 0.9)elif i > 60 and i < 105:fd(a2 + 0.9)right(b2 - 0.2)elif i > 104:fd(a2 + 0.5)right(b2 + 0.31)right(130)for i in range(1,36):fd(a2)left(b2 - 0.15)right(45)for i in range(1,101):if i < 41:fd(a2)left(b2 - 0.05)elif i > 40:fd(a2 + 0.2)if i == 41:left(30)else:left(b2 - 0.3)left(155)for i in range(1,201):if i < 50:fd(a2)right(b2 - 0.15)elif i > 49 and i < 90:fd(a2 + 0.4)right(b2 + 0.8)elif i >89 and i < 106:fd(a2 + 0.5)left(b2 + 0.8)goto(-87,87)for i in range(1,41):if i == 1:right(20)fd(0.9)right(b1 - 0.7)if i > 15 and i < 26:right(0.2)elif i > 25:left(0.4)left(30)for i in range(1,16):fd(a1)right(b1)def meimao1(e2):left(160)for i in range(1,6):fd(e2)left(90)e2 += 4right(58)for i in range(1,11):if i < 11:fd(4)right(19)for i in range(1,91):fd(0.6)left(0.3)left(40)for i in range(1,71):fd(0.5)right(0.4 - 0.15)left(175)for i in range(1,76):  if i < 56:fd(1)right(1)else:fd(0.5 + 0.5)left(0.4 + 0.8)for i in range(47):fd(1)if i == 46:left(0.5)else:left(0.8)def meimao2(f2,g2,h2,i2):right(170)for i in range(1,6):fd(f2)right(90)f2 += 4f2 = 5left(70)for i in range(1,21):if i > 10:if i == 11:left(17)else:if i > 16:left(0.2)else:fd(f2 - 4)left(g2 + 0.4)else:fd(f2 - 3.5)for i in range(1,33):if i < 11:fd(f2 - 3)right(g2 + 0.2)g2 += 0.3if i < 16 and i > 10:fd(f2 - 3)right(g2 + 0.3)g2 += 0.65elif i > 15:fd(f2 - 1.5)right(g2 + 0.4)g2 -= 0.5right(175)for i in range(1,80):fd(i2)left(h2)if i > 69:if i == 70:h2 = 0.5i2 = 1.5else:h2 += 0.32else:h2 = 0.8i2 = 0.5for i in range(1,26):if i < 11:fd(f2 - 3.5)else:if i == 1:left(17)g2 = 0.4else:if i > 24:left(0.2)else:fd(f2 - 4)left(g2 + 0.4)for i in range(1,21):fd(1)right(1)def yanjing1(j2,k2):right(20)for i in range(1,16):fd(0.7)right(0.8)for i in range(1,51):if i < 21:j2 += 1fd(0.1)right(j2)elif i > 20 and i < 38:if j2 > 0.4:j2 -= 1.6fd(k2 - 9)right(j2)k2 += 0.8left(100)fd(21)dot(20)fd(20)def yanjing2(l1,l2,a3):left(138)for i in range(1,16):fd(0.6)left(1.2)for i in range(1,36):if i < 21:fd(0.9)left(l1)l1 += 0.2elif i > 20:fd(l2 + 0.1)left(a3 - 0.6)l2 += 0.18a3 += 0.19left(140)fd(29)dot(25)fd(28)def cefa1(b3):right(17)fd(30)left(60)fd(10)left(120)fd(12)for i in range(1,26):fd(0.9)left(b3)b3 += 0.08def cefa2(c3):for i in range(1,6):right(90)fd(c3)c3 += 8fd(20)right(12)for i in range(1,231):if i > 135:if i > 170:fd(1)right(0.2)else:fd(0.5)right(0.4)elif i > 105 and i < 136:fd(0.3)right(1.2)elif i > 95 and i < 106:fd(0.3)right(1.3)elif i > 50 and i < 95:fd(1.4)left(0.2)elif i < 51:fd(1)left(0.71)right(140)for i in range(1,146):if i > 105 and i < 146:fd(0.3)right(1.2)elif i > 95 and i < 106:fd(0.3)right(1.3)elif i > 50 and i < 95:fd(1.4)left(0.2)elif i < 51:fd(1)left(0.71)left(180)for i in range(1,41):fd(0.3)left(1.2)right(45)for i in range(1,21):fd(1)right(0.2)right(125)for i in range(1,31):fd(1)right(0.68)for i in range(1,46):fd(1)right(0.3)for i in range(1,81):fd(0.5)right(0.4)for i in range(1,108):fd(0.47)right(0.4)def xbzbbz(d3,e3):left(78)for i in range(1,51):fd(0.9)right(0.5)for i in range(1,35):fd(1)right(0.4)for i in range(1,19):fd(d3)right(e3)e3 += 0.4d3 += 0.1taibi(-197,9)right(170)d3 = 0.4e3 = 1for i in range(1,83):if i > 45:d3 = 0.2e3 = 0.8fd(e3)left(d3) else:fd(e3)left(d3)d3 += 0.05e3 += 0.02taibi(-126,-28)left(48)yanse('#51150b')fillcolor('#51150b')begin_fill()for i in range(1,46):fd(0.8)left(0.8)left(90)for i in range(1,76):if i < 7:fd(0.7)left(1)elif i < 69 and i > 6:fd(0.5)left(0.2)else:fd(0.7)left(1)left(83)for i in range(1,46):fd(0.8)left(0.8)end_fill()taibi(-140,-42)yanse('chocolate1')right(4)fd(12)left(48)fd(30)left(58)fd(13)def lingfa1(f3,g3,h3):for i in range(1,5):left(90)fd(f3)f3 += 3left(78)fd(16)left(50)fd(5)right(60)fd(11)left(55)for i in range(1,26):if g3 < 1.63:fd(h3)right(1.3)else:fd(h3)right(g3)g3 -= 0.049h3 -= 0.025left(110)for i in range(1,84):fd(0.79)left(1.1)for i in range(1,71):fd(0.5)left(1)def lingfa2(i3):for i in range(1,5):fd(i3)i3 += 3right(90)left(10)fd(9)right(45)fd(12)left(58)fd(12)right(53)for i in range(1,90):fd(0.9)left(0.5)right(9.8)fd(10)right(76)for i in range(1,98):fd(0.47)left(0.4)for i in range(1,71):fd(0.5)left(0.4)right(40)for i in range(1,31):fd(0.7)right(0.5)right(140)for i in range(1,131):if i > 105:fd(0.5)right(1.2)elif i > 50 and i < 106:fd(0.7)right(1)elif i < 51:fd(0.85)left(0.55)left(165)for i in range(1,31):fd(0.7)right(0.5)right(145)for i in range(1,89):fd(0.65)left(1.19999999999999999999999999999)for i in range(1,91):fd(0.85)right(1.45)def lingdang():dot(40,'darkorange1')taibi(-133,-87)right(110)for i in range(1,48):fd(0.7)right(0.52)taibi(-133,-95)left(25)for i in range(1,51):fd(0.7)right(0.52)taibi(-113,-102)dot(9,'lightsalmon4')yanse('lightsalmon4')right(88)fd(12)def xiabanshen():fd(80)left(72)for i in range(1,51):fd(1)left(1.1)taibi(-90,-89)right(132)for i in range(1,86):fd(1)left(0.25)left(75)for i in range(1,48):fd(1.1)left(0.7)left(65)fd(63)taibi(-45,-135)right(80)fd(50)taibi(19,-90)right(142)for i in range(1,51):fd(1)left(1)right(15)fd(20)left(88)for i in range(1,61):fd(0.9)left(0.6)left(80)fd(12)left(70)fd(2)right(100)fd(2)for i in range(1,156):if i < 41:fd(0.99)right(0.4)elif i > 40 and i < 100:if i == 41:left(25)else:fd(1)left(1)elif i > 100:fd(0.7)left(0.3)def weiba(l3,l4):right(130)for i in range(1,211):if i < 101:if i < 20:fd(0.8)right(1.1)else:fd(1)left(0.78)elif i < 111 and i > 100:if i == 101:left(90)fd(1)elif i == 110:fd(1)left(90)else:fd(1)else:if i > 190:fd(0.72)left(0.9)else:fd(1)right(0.9)taibi(130,0)left(146)begin_fill()for i in range(1,6):fd(l3)left(90)l3 += 3right(26)for i in range(1,201):if i < 81:fd(0.8)left(1)elif i < 101 and i > 80:if i == 81:right(32)fd(0.5)elif i == 100:left(66)else:fd(0.5)elif i < 121 and i > 100:if i == 120:fd(0.5)right(32)elif i == 101:left(66)else:fd(0.5)else:fd(0.8)left(1)right(26)for i in range(1,6):left(90)l4 -= 3fd(l4)end_fill()hideturtle()yanse('coral4')
taibi(-200,200)
jiao(-0.6,1.2,0.4,0)taibi(-130,68)
yanse('chocolate1')
fillcolor('darkorange')
begin_fill()
dingfa(0.5,1.2,1.2,0.8,4,0.6,0.3,0.8,0.3,0.6,0.2,0.5,0.4,1,0.8)
end_fill()taibi(-80,26)
yanse('black')
fillcolor('white')
begin_fill()
yanjing2(0.5,1,1)
end_fill()taibi(-87,39)
yanse('goldenrod1')
fillcolor('darkorange')
begin_fill()
meimao1(5)
end_fill()taibi(-160,27)
yanse('black')
fillcolor('white')
begin_fill()
yanjing1(1,1)
end_fill()taibi(-155,39)
yanse('goldenrod1')
fillcolor('darkorange')
begin_fill()
meimao2(5,0.4,0.5,1.2)
end_fill()taibi(-207,49)
yanse('goldenrod1')
fillcolor('darkorange')
begin_fill()
cefa1(1)
end_fill()taibi(-38,22)
yanse('goldenrod1')
fillcolor('darkorange')
begin_fill()
cefa2(6.5)
end_fill()taibi(-38,-2)
yanse('chocolate1')
xbzbbz(0.9,2.1)taibi(-130,-64)
yanse('goldenrod1')
fillcolor('darkorange')
begin_fill()
lingfa1(5,2.6,1.9)
end_fill()taibi(-108,-64)
fillcolor('darkorange')
begin_fill()
lingfa2(5)
end_fill()taibi(-115,-94)
yanse('firebrick2')
lingdang()taibi(-136,-87)
yanse('chocolate1')
xiabanshen()taibi(55,-65)
yanse('goldenrod1')
weiba(5,20)done()

ps:本人现在在读初二,有文字表述错误纯属正常,还望各位多多谅解,多多包容噢(有错就指出,不要客气)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/251785.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

教程 | 10分钟入门禅绕画 (上)

有人说&#xff0c;禅绕画没有任何美术基础也可以画的好的。 事实上&#xff0c;缠绕画对美学的感受能力有一定要求&#xff0c;想画好禅绕画需要熟知多个常用的禅绕元素。只有在掌握基本元素后&#xff0c;勤加练习&#xff0c;才能随心所欲想画就画。 我个人认为&#xff0c;…

用Python画一只溜达小狗——turtle库基础入门

一只脑门有点方的小狗&#xff0c;其实还可以把脑门和后脑勺完善一下&#xff0c;更圆润一些。 但这样也挺可爱&#xff0c;就保有这样不完美但独一无二的它吧。绘制过程主要就是拼接和调整圆弧&#xff0c;尽量做到过度自然。 小狗的绘制主要使用了turtle库的circle()函数&am…

用Python的Turtle画哆啦A梦

这是我几年前为了练习python的turtle库而画的&#xff0c;今天翻出了代码&#xff0c;分享给大家。 这是我初学python时画的&#xff0c;当时还没有面向对象的概念&#xff0c;也没有采取类方法之类&#xff0c;纯原始手工&#xff0c;供大家参考。 若有兴趣可以自行优化简洁…

python画圣诞树【方块圣诞树、线条圣诞树、豪华圣诞树】

文章目录 前言【便捷源码下载处】1.方块圣诞树2.线条圣诞树3.豪华圣诞树 这篇文章主要介绍了使用Python画了一棵圣诞树的实例代码,本文通过实例代码给大家介绍的非常详细&#xff0c;对大家的学习或工作具有一定的参考借鉴价值&#xff0c;需要的朋友可以参考下 前言【便捷源码…

Python绘图案例实战——用Python画哆啦A梦(超详细步骤分解)

写在前面&#xff1a; 本文基于64位windows系统(鼠标右键点击桌面“此电脑”图标——属性可查看电脑系统版本&#xff09;、python3.x(pycharm自动安装的版本, 3.0以上)。文中代码内容所使用的工具是pycharm-community-2020.1&#xff0c;实践中如有碰到问题&#xff0c;可留言…

python画可爱哆啦A梦

编译环境&#xff08;python3.7&#xff09; 第一步&#xff1a;打开python3.7,new一个file 第二步&#xff1a;输入代码&#xff0c;run一下 第三步&#xff1a;保存文件&#xff08;注意路径&#xff0c;最好新建一个文件夹用来存放项目&#xff09; 最后就完成啦&#xff0…

用Python海龟画图画哆啦A梦

文章目录 前言一、画哆啦A梦脸的外圈蓝色二、画哆啦A梦脸的内圈白色三、哆啦A梦的鼻子四、哆啦A梦的鼻尖五、哆啦A梦的左眼六、哆啦A梦的右眼七、哆啦A梦的左眼内部八、哆啦A梦的右眼内部九、 哆啦A梦的右眼内部白色圆点十、 哆啦A梦的鼻子下面的黑色竖线十一、 哆啦A梦的右边的…

用 Python 画哆啦 A 梦

文 | 豆豆 来源&#xff1a;Python 技术「ID: pythonall」 相信大家童年的时候都看过哆啦 A 梦&#xff0c;他的口袋简直是无所不能&#xff0c;里面装满了各种神奇的道具。曾经的我也幻想过如果自己也有一个这样的口袋多好。今天我们就用 Python 来画一个哆啦 A 梦&#xff0c…

SpringBoot+MyBatis-plus实现CRUD (踩坑总结!!!)

一、创建项目&#xff0c;引入相应的依赖 (项目源码在文末) &#xff08;不要选Module !!!!&#xff09; <dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.4.2</version&g…

Linux 常用命令: 查看 CPU 信息

强力推荐-不要错过&#xff0c;万一能帮助到自己呢&#xff1f; 推荐一个网站&#xff0c;关于人工智能教程&#xff0c;教程不仅是零基础&#xff0c;通俗易懂&#xff0c;而且非常风趣幽默&#xff0c;像看小说一样&#xff01;觉得太牛了&#xff0c;所以分享给大家。点 这…

js获取body或屏幕的宽度大集合

Js代码 //【转】js获取body或屏幕的宽度大集合 var s " "; document.documentElement.scrollTop 就是滚动条距离顶部的位置&#xff08;可变&#xff09; document.documentElement.scrollLef 指滚动条距离左边的位置&#xff08;可变&#xff0…

js获取屏幕、浏览器、页面的宽度和高度

介绍 容器的尺寸是指当前分辨率下的高度和宽度&#xff08;分辨率不同&#xff0c;值就不相同&#xff09; 屏幕信息 screen.height&#xff1a;屏幕高度 screen.availHeight&#xff1a;屏幕可用宽度 screen.height - acreen.availHeight&#xff1a;任务栏高度 浏览器信息…

PHPMySQL基础(四):模拟登录Login功能案例

PHP&MySQL基础&#xff08;一&#xff09;:创建数据库并通过PHP进行连接_长风沛雨的博客-CSDN博客 PHP&MySQL基础&#xff08;二&#xff09;:通过PHP对MySQL进行增、删、改、查_长风沛雨的博客-CSDN博客 PHP&MySQL基础&#xff08;三&#xff09;:处理查询SQL返…

《物联网IoT解决方案》(Unity+SteamVR+云技术+5G+AI+物联网+IoT+人机交互+万物互联+物物互联+射频识别+全球定位系统+实时采集+智能化感知+识别+管理+立钻哥哥+==)

《物联网IoT解决方案》 版本 作者 参与者 完成日期 备注 YanlzVR_IoT_V01_1.0 严立钻 2020.05.05 ##《物联网IoT解决方案》发布说明&#xff1a; “物联网IoT解决方案”&#xff1a;是对“IoT”的基础探索&#xff1b;【VR云游戏】&#xff1a;U…

创建联系人vcf文件通讯录

现在的app动不动就要访问手机联系人&#xff0c;于是突发奇想把自己手机里面导很多假联系人&#xff0c;让他去获取。于是随便写了一下代码生成了.vcf后缀的联系人文件&#xff0c;可以直接导入到手机里面去。下面代码一些写的不规范&#xff1a;比如流的关闭、异常的处理、数据…

CAD测面积周长

点取闭合区域中的一点&#xff0c;计算闭合区域的面积。 1.单击ET”工具栏的“面积周长命令”按钮。 2.在命令行中输入ET_CaleArea&#xff0c;按回车键。 执行命令后&#xff0c;命令行将显示如下信息&#xff1a; 命令: MxET_CaleArea 拾取闭合区域内部点: 计算的面积为…

怎样去测量CAD面积?

2019独角兽企业重金招聘Python工程师标准>>> 我们在利用CAD看图软件查看CAD图纸时&#xff0c;有时候需要对里面的CAD图形面积进行测量&#xff0c;那么我们应该怎么测量CAD图纸面积&#xff1f;怎样用CAD测量面积&#xff1f;CAD面积怎么算&#xff1f; 1.准备一款…

ROS:发布者Publisher的编程实现(C++)

目录 一、话题模型二、创建功能包三、创建Publisher代码四、编译代码五、运行 一、话题模型 图中&#xff0c;我们使用ROS Master管理节点。 有两个主要节点&#xff1a; Publisher&#xff0c;名为Turtle Velocity&#xff08;即海龟的速度&#xff09; Subscriber&#xff0c…

GlobalMapper20:10分钟根据CAD、shp等离散高程点生成一份精准边界的地形数据

序&#xff1a; 做工程设计&#xff0c;规划设计也好&#xff0c;经常性需要地形数据&#xff0c;而到手的数据多数为excel、txt等文本文件&#xff0c;或者等高线等cad文件。 设计方案汇报是设计项目经理的主要职责&#xff0c;经常需要把设计中的地形&#xff08;shp、cad、…

CAD中怎么批量标注坐标?CAD批量标注坐标​

在CAD绘图过程中&#xff0c;当需要进行有大量CAD坐标标注时&#xff0c;该如何操作呢&#xff1f;下面就来和小编一起来了解一下浩辰CAD建筑中关于批量标注普通坐标的相关操作步骤吧&#xff01; CAD批量标注普通坐标操作步骤&#xff1a; 首先打开浩辰CAD建筑软件&#xff…