描点画图的五星红旗程序

描点画图的五星红旗程序

描点画图五星红旗Python程序

描点画图五星红旗Python程序

import random
import turtle

turtle.ht()
turtle.setup(1024,800)
turtle.title('画这图.jpg')
turtle.colormode(255)
turtle.speed(0)
turtle.delay(0)
turtle.pensize(3)

all_xy = []
xy_0 =  [(-395, -287), (242, -279), (230, 275), (-393, 264), (-395, -287), (157, 189, 227)]
xy_1 =  [(-106, 103), (-107, -119), (158, -119), (152, 106), (-106, 103), (157, 189, 227)]
xy_2 =  [(-85, -117), (-84, 134), (109, 135), (110, 112), (113, -118), (-85, -117), (157, 189, 227)]
xy_3 =  [(-28, -77), (-29, 103), (-51, 102), (-50, -102), (-28, -77), (9, 46, 91)]
xy_4 =  [(66, -81), (66, 106), (91, 105), (90, -103), (66, -81), (9, 46, 91)]
xy_5 =  [(-15, -30), (48, -30), (49, -38), (-18, -39), (-15, -30), (157, 170, 186)]
xy_6 =  [(-10, -39), (-9, -67), (-3, -67), (-2, -39), (-10, -39), (157, 170, 186)]
xy_7 =  [(38, -40), (39, -67), (46, -67), (47, -39), (38, -40), (157, 170, 186)]
xy_8 =  [(-21, -69), (-60, -117), (107, -119), (54, -68), (-21, -69), (133, 155, 186)]
xy_9 =  [(-25, -81), (56, -80), '']
xy_10 =  [(47, -90), (-21, -90), '']
xy_11 =  [(1, -105), (88, -104), '']
xy_12 =  [(-80, 127), (108, 129), '']
xy_13 =  [(-70, 103), (-69, -116), '']
xy_14 =  [(-40, -88), (-39, 78), '']
xy_15 =  [(1, -24), (0, 105), '']
xy_16 =  [(25, -29), (26, 106), '']
xy_17 =  [(47, -29), (46, 107), '']
xy_18 =  [(107, -46), (107, 76), '']
xy_19 =  [(81, -73), (80, 78), '']
xy_20 =  [(-89, 120), (-112, 159), '']
xy_21 =  [(110, 114), (134, 163), '']
xy_22 =  [(-112, 160), (135, 161), (110, 135), (-83, 135), (-112, 160), (77, 102, 122)]
xy_23 =  [(-86, 151), (-68, 150), (-68, 142), (-79, 141), (-86, 151), (11, 32, 79)]
xy_24 =  [(-54, 150), (-36, 150), (-36, 142), (-54, 142), (-54, 150), (11, 32, 79)]
xy_25 =  [(-23, 150), (-8, 150), (-8, 142), (-24, 142), (-23, 150), (11, 32, 79)]
xy_26 =  [(6, 153), (25, 153), (26, 141), (5, 142), (6, 153), (11, 32, 79)]
xy_27 =  [(39, 152), (52, 151), (51, 141), (39, 142), (39, 152), (11, 32, 79)]
xy_28 =  [(64, 151), (77, 151), (77, 144), (64, 143), (64, 151), (11, 32, 79)]
xy_29 =  [(92, 149), (111, 150), (103, 141), (92, 140), (92, 149), (11, 32, 79)]
xy_30 =  [(-393, 96), (-364, 69), (-363, -47), '']
xy_31 =  [(-236, 77), (-166, 78), (-151, 65), (-151, -120), '']
xy_32 =  [(-166, 78), (-166, -121), '']
xy_33 =  [(-236, 76), (-236, 58), '']
xy_34 =  [(-372, 54), (-199, 57), (-179, 35), (-179, -120), '']
xy_35 =  [(-364, -7), (-221, -5), (-223, -62), (-296, -61), '']
xy_36 =  [(-198, 58), (-197, -119), '']
xy_37 =  [(-209, -3), (-196, -2), (-181, -15), '']
xy_38 =  [(-209, -62), (-198, -61), (-180, -71), '']
xy_39 =  [(-180, 35), (-166, 35), (-151, 28), '']
xy_40 =  [(-176, 1), (-167, 3), (-151, -3), '']
xy_41 =  [(-178, -35), (-166, -37), (-152, -45), '']
xy_42 =  [(-179, -79), (-166, -79), (-151, -89), '']
xy_43 =  [(-343, 39), (-324, 39), (-325, 11), (-343, 11), (-343, 39), (11, 32, 79)]
xy_44 =  [(-307, 39), (-260, 39), (-259, 15), (-308, 15), (-307, 39), (11, 32, 79)]
xy_45 =  [(-246, 42), (-231, 39), (-233, 12), (-253, 12), (-246, 42), (11, 32, 79)]
xy_46 =  [(-344, -21), (-281, -21), (-282, -50), (-344, -50), (-344, -21), (11, 32, 79)]
xy_47 =  [(-265, -49), (-233, -48), (-234, -22), (-266, -24), (-265, -49), (11, 32, 79)]
xy_48 =  [(234, 84), (203, 84), (180, 67), (185, -54), '']
xy_49 =  [(203, 82), (206, -49), '']
xy_50 =  [(234, 57), (217, 44), (220, -51), '']
xy_51 =  [(220, 0), (236, 13), '']
xy_52 =  [(222, -53), (237, -39), '']
xy_53 =  [(203, 55), (183, 38), '']
xy_54 =  [(203, 28), (184, 12), '']
xy_55 =  [(219, -19), (206, -19), (185, -35), '']
xy_56 =  [(-224, -221), (-223, 238), (-216, 237), (-210, 240), (-210, -221), (-224, -221), (150, 162, 160)]
xy_57 =  [(-208, 241), (-196, 233), (-182, 227), (-172, 228), (-165, 230), (-158, 235), (-147, 239), (-132, 240), (-121, 240), (-111, 238), (-101, 233), (-98, 229), (-97, 167), (-111, 175), (-123, 176), (-134, 176), (-149, 170), (-159, 164), (-170, 160), (-183, 159), (-194, 159), (-203, 165), (-209, 167), (-208, 241), (255, 0, 0)]
xy_58 =  [(-224, 240), (-228, 249), (-227, 255), (-218, 258), (-210, 257), (-206, 253), (-205, 246), (-209, 242), (-215, 239), (-224, 240), (12, 5, 250)]
xy_59 =  [(87, -202), (161, -199), (165, -218), (88, -217), (87, -202), (255, 255, 255)]
xy_60 =  [(-260, -224), (-173, -222), (-172, -242), (-154, -243), (-136, -283), (-307, -285), (-278, -240), (-282, -247), (-260, -247), (-260, -224), (255, 255, 255)]
xy_61 =  [(-283, -244), (-157, -242), '']
xy_62 =  [(120, -196), (121, -95), (133, -95), (134, -199), (120, -196), (128, 0, 0)]
xy_63 =  [(239, -165), (135, -133), (115, -124), (98, -124), (90, -114), (86, -110), (77, -105), (71, -95), (69, -87), (71, -80), (74, -73), (84, -68), (86, -64), (86, -57), (89, -48), (102, -44), (112, -43), (120, -31), (136, -28), (146, -34), (147, -44), (148, -44), (160, -46), (167, -50), (172, -60), (166, -71), (163, -80), (179, -79), (179, -96), (168, -106), (161, -114), (154, -125), (135, -127), (135, -131), (239, -165), (0, 128, 0)]
xy_64 =  [(167, -49), (183, -61), (187, -50), (204, -46), (221, -52), (221, -59), (231, -65), (238, -70), (240, -164), (135, -133), (134, -126), (148, -124), (152, -124), (155, -119), (158, -114), (164, -109), (166, -105), (170, -102), (173, -99), (177, -97), (178, -90), (178, -79), (167, -79), (163, -79), (164, -73), (166, -69), (170, -62), (171, -58), (167, -49), (0, 128, 0)]
xy_65 =  [(-393, -173), (-393, -90), (-386, -83), (-378, -78), (-372, -78), (-366, -82), (-364, -71), (-360, -64), (-355, -60), (-349, -58), (-342, -58), (-332, -60), (-331, -63), (-329, -68), (-322, -61), (-311, -61), (-302, -61), (-293, -63), (-286, -69), (-284, -73), (-293, -82), (-280, -78), (-266, -81), (-260, -91), (-254, -99), (-251, -104), (-259, -93), (-248, -91), (-243, -93), (-233, -98), (-226, -106), (-224, -112), (-224, -117), (-393, -173), (0, 128, 0)]
xy_66 =  [(-360, -119), (-349, -97), (-330, -94), (-319, -100), (-305, -100), (-289, -110), '']
xy_67 =  [(-271, -77), (-234, -79), (-228, -80), (-228, -99), '']
xy_68 =  [(-394, -199), (-330, -154), '']
xy_69 =  [(-394, -255), (-283, -148), '']
xy_70 =  [(20, -278), (-98, -123), '']
xy_71 =  [(115, -277), (-68, -134), '']
xy_72 =  [(187, -92), (197, -80), (204, -76), (216, -77), (227, -87), (228, -93), '']
xy_73 =  [(206, -101), (209, -93), (215, -91), (220, -91), (227, -97), (230, -100), (235, -107), (237, -111), '']
xy_74 =  [(-210, -121), (155, -118), '']
xy_75 =  [(-228, -104), (-252, -104), '']
xy_76 =  [(-33, 109), (68, 107), (67, 125), (-31, 127), (-33, 109), (0, 64, 64)]

for i in range(77):
   all_xy.append(eval('xy_' + str(i)))

k = 1
for cors in all_xy:
    turtle.penup()
    x,y = cors[0]
    turtle.goto(x/k,y/k)
    turtle.pendown()
    if cors[-1]!='':
       turtle.fillcolor(cors[-1])
       turtle.begin_fill()
    for x,y in cors[1:-1]:
        turtle.goto(x/k,y/k)
    if cors[-1]!='':    
       turtle.end_fill()

turtle.color('yellow')
turtle.st()
turtle.penup()
turtle.goto(-190,210)
turtle.begin_fill()
for _ in range(5):
   turtle.fd(30)
   turtle.rt(144)
turtle.end_fill()


turtle.goto(-165,225)
turtle.begin_fill()
for _ in range(5):
   turtle.fd(10)
   turtle.rt(144)
turtle.end_fill()


turtle.goto(-150,210)
turtle.begin_fill()
for _ in range(5):
   turtle.fd(10)
   turtle.rt(144)
turtle.end_fill()

turtle.goto(-150,195)
turtle.begin_fill()
for _ in range(5):
   turtle.fd(10)
   turtle.rt(144)
turtle.end_fill()

turtle.goto(-160,185)
turtle.begin_fill()
for _ in range(5):
   turtle.fd(10)
   turtle.rt(144)
turtle.end_fill()

turtle.ht()
turtle.done()
李兴球

李兴球的博客是Python创意编程原创博客