How to draw a new year beast (with code and tutorial)

Posted by mania on Thu, 03 Feb 2022 02:46:42 +0100

Drawing new year animals is actually a very brain intensive and troublesome thing - especially when the coordinates, line length and other parameters have not been determined. I risked losing all my hair and drew a new year beast (??) (as shown below)

The Chinese New Year is coming soon. I wish you an early New Year ~ hey hey, I wish you all who read this article have a safe body, everything you want and all the best~

OK, I won't say much nonsense. Now I'll share my practice with you

1. Import turtle first

from turtle import *
#Or import turtle

from... import... Is used because the program can be simplified later when writing the program.

For example: TLE fd () can be abbreviated as fd()#forward can be abbreviated as fd

2. Set the title in the upper left corner, screen length and width, brush speed and width. Then hide the brush

title('The year beast is coming~~~')#Set the title in the upper left corner as' the year beast is coming ~ ~ ~ '
screensize(1000,900,'red')#Set the screen length, width and color
speed(0)#Set brush speed (max 0)
pensize(5)#Sets the width of the brush
hideturtle()#Hide brush

Then I will divide the program into call area and definition area (the definition area is above the call area)

Note: title 3 to title are defined areas

3. Set the function "taibi" (to facilitate pen lifting, determine the position, and then write)

def taibi(x,y):#def is followed by the function name, and variables are in parentheses
    up()#pen-up 
    goto(x,y)#Move the brush to a position where the abscissa is x and the ordinate is y
    down()#Write

Because the program repeatedly uses these modules, I integrate them into a function to facilitate call and output

(4.) This function can be set or not. I am lazy and want to type a few letters less (set the color of the pen)

def yanse(a):
    pencolor(a)
#Or you can just use pencolor(), so you don't need to set the function

4. Define the function to draw the angle of Nian beast

def jiao(f,g,h,j):
    fillcolor('coral4')#Where is this color https://tool.oschina.net/commons?type=3 Detailed introduction
    begin_fill()
    right(95)

    #First line of corner

    for i in range(1,131):
        fd(1)
        right(f)
    left(25)#Adjust the angle of the brush

    #Second line of corner

    for i in range(1,46):
        fd(1)
        left(g)
        g += 0.1

    #Third line of corner

    for i in range(1,111):
        fd(1)
        right(h)
        #Use the if conditional judgment statement to adjust the brush at the appropriate time
        if i > 89:
            h += 0.03
            j += 1
    end_fill()
#Call as follows
yanse('coral4')
taibi(-200,200)
jiao(-0.6,1.2,0.4,0)

 5. Draw the hair of the beast and still define the function

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.8
        if i > 10 and i <80:
            k = 0.8
            l = 0.5
        elif i>79:
            k = 0.5
            l = 1.1
    right(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.06
    right(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.5
            if d1 > -0.6:
                d1 -= 0.3
        elif i > 160:
            d1 = -0.7
            c1 = 0.7
    right(125)
    for i in range(1,121):
        fd(e1)
        right(f1)
        if i > 109:
            f1 += 0.01
    left(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.03
    right(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)
#Call as follows
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. We define the eyebrow function and the eyes. Because the black eyes I draw are drawn with dot and need to be covered with eyebrows, we draw the eyes first and then the eyebrows (eyebrows and eyes define two functions respectively to distinguish them)

def meimao1(e2):
    left(160)
    for i in range(1,6):
        fd(e2)
        left(90)
        e2 += 4#Change shape by increasing or decreasing
    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 += 4
    f2 = 5
    left(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.3
        if i < 16 and i > 10:
            fd(f2 - 3)
            right(g2 + 0.3)
            g2 += 0.65
        elif i > 15:
            fd(f2 - 1.5)
            right(g2 + 0.4)
            g2 -= 0.5
    right(175)
    for i in range(1,80):
        fd(i2)
        left(h2)
        if i > 69:
            if i == 70:
                h2 = 0.5
                i2 = 1.5
            else:
                h2 += 0.32
        else:
            h2 = 0.8
            i2 = 0.5
    for i in range(1,26):
        if i < 11:
            fd(f2 - 3.5)
        else:
            if i == 1:
                left(17)
                g2 = 0.4
            else:
                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 += 1
            fd(0.1)
            right(j2)
        elif i > 20 and i < 38:
            if j2 > 0.4:
                j2 -= 1.6
                fd(k2 - 9)
                right(j2)
                k2 += 0.8
    left(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.2
        elif i > 20:
            fd(l2 + 0.1)
            left(a3 - 0.6)
            l2 += 0.18
            a3 += 0.19
    left(140)
    fd(29)
    dot(25)
    fd(28)
#Call as follows
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. Then we draw the sideburns on both sides of Nian beast (I call it side hair here)

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 += 8
    fd(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)
#The output is as follows
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. Draw chin, nose and mouth (both defined in a function)

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.4
        d3 += 0.1
    taibi(-197,9)
    right(170)
    d3 = 0.4
    e3 = 1
    for i in range(1,83):
        if i > 45:
            d3 = 0.2
            e3 = 0.8
            fd(e3)
            left(d3) 
        else:
            fd(e3)
            left(d3)
            d3 += 0.05
            e3 += 0.02
    taibi(-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)
#Call as follows
taibi(-38,-2)
yanse('chocolate1')
xbzbbz(0.9,2.1)
taibi(-130,-64)

9. Draw the sideburns near the neck (collar hair for short)

def lingfa1(f3,g3,h3):
    for i in range(1,5):
        left(90)
        fd(f3)
        f3 += 3
    left(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.049
            h3 -= 0.025
    left(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 += 3
        right(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)
#Call as follows
taibi(-38,-2)
yanse('chocolate1')
xbzbbz(0.9,2.1)

10. Draw bell (use dot function to draw circle again)

def lingdang():
    dot(40,'darkorange1')#Dot (diameter, color (default black))
    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)
#Call as follows
taibi(-115,-94)
yanse('firebrick2')
lingdang()

11. The penultimate step is the lower body

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)
#Call as follows
taibi(-136,-87)
yanse('chocolate1')
xiabanshen()

12. In the end, it's just the tail

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 += 3
    right(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 -= 3
        fd(l4)
    end_fill()
#Call as follows
taibi(55,-65)
yanse('goldenrod1')
weiba(5,20)

Finally, don't forget to add done(), otherwise the program will close as soon as it runs

The source code is as follows:

from turtle import *
title('The year beast is coming~~~')
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.1
    for i in range(1,111):
        fd(1)
        right(h)
        if i > 89:
            h += 0.03
            j += 1
    end_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.8
        if i > 10 and i <80:
            k = 0.8
            l = 0.5
        elif i>79:
            k = 0.5
            l = 1.1
    right(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.06
    right(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.5
            if d1 > -0.6:
                d1 -= 0.3
        elif i > 160:
            d1 = -0.7
            c1 = 0.7
    right(125)
    for i in range(1,121):
        fd(e1)
        right(f1)
        if i > 109:
            f1 += 0.01
    left(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.03
    right(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 += 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 += 4
    f2 = 5
    left(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.3
        if i < 16 and i > 10:
            fd(f2 - 3)
            right(g2 + 0.3)
            g2 += 0.65
        elif i > 15:
            fd(f2 - 1.5)
            right(g2 + 0.4)
            g2 -= 0.5
    right(175)
    for i in range(1,80):
        fd(i2)
        left(h2)
        if i > 69:
            if i == 70:
                h2 = 0.5
                i2 = 1.5
            else:
                h2 += 0.32
        else:
            h2 = 0.8
            i2 = 0.5
    for i in range(1,26):
        if i < 11:
            fd(f2 - 3.5)
        else:
            if i == 1:
                left(17)
                g2 = 0.4
            else:
                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 += 1
            fd(0.1)
            right(j2)
        elif i > 20 and i < 38:
            if j2 > 0.4:
                j2 -= 1.6
                fd(k2 - 9)
                right(j2)
                k2 += 0.8
    left(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.2
        elif i > 20:
            fd(l2 + 0.1)
            left(a3 - 0.6)
            l2 += 0.18
            a3 += 0.19
    left(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.08

def cefa2(c3):
    for i in range(1,6):
        right(90)
        fd(c3)
        c3 += 8
    fd(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.4
        d3 += 0.1
    taibi(-197,9)
    right(170)
    d3 = 0.4
    e3 = 1
    for i in range(1,83):
        if i > 45:
            d3 = 0.2
            e3 = 0.8
            fd(e3)
            left(d3) 
        else:
            fd(e3)
            left(d3)
            d3 += 0.05
            e3 += 0.02
    taibi(-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 += 3
    left(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.049
            h3 -= 0.025
    left(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 += 3
        right(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 += 3
    right(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 -= 3
        fd(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: I'm reading the second year of junior high school. It's normal for me to make mistakes in words. I hope you can understand and tolerate more (if you make mistakes, you're welcome to point them out)

Topics: Python