-
Notifications
You must be signed in to change notification settings - Fork 0
/
felix-2022.py
executable file
·82 lines (72 loc) · 6.14 KB
/
felix-2022.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from turtle import RawTurtle, Screen
from typing import List, Sequence
polygons = [
{
"color": "black",
"points": [
[-55.0, 277.0], [-62.0, 293.0], [-65.0, 314.0], [-63.0, 330.0], [-59.0, 345.0], [-50.0, 356.0], [-35.0, 364.0], [-20.0, 368.0], [-3.0, 365.0],
[7.0, 360.0], [17.0, 349.0], [25.0, 337.0], [29.0, 323.0], [31.0, 305.0], [31.0, 296.0], [34.0, 286.0], [31.0, 281.0], [25.0, 269.0], [12.0, 261.0],
[8.0, 256.0], [1.0, 247.0], [5.0, 236.0], [11.0, 228.0], [26.0, 219.0], [44.0, 208.0], [53.0, 196.0], [58.0, 180.0], [67.0, 122.0], [60.0, 116.0],
[57.0, 116.0], [58.0, 107.0], [60.0, 94.0], [68.0, 86.0], [71.0, 71.0], [70.0, 58.0], [72.0, 43.0], [70.0, 40.0], [74.0, -2.0], [78.0, -4.0],
[78.0, -7.0], [79.0, -10.0], [78.0, -11.0], [77.0, -12.0], [76.0, -20.0], [78.0, -23.0], [81.0, -36.0], [81.0, -47.0], [75.0, -52.0], [67.0, -56.0],
[59.0, -55.0], [56.0, -49.0], [55.0, -41.0], [57.0, -32.0], [57.0, -23.0], [57.0, -7.0], [55.0, -8.0], [55.0, -3.0], [57.0, 2.0], [48.0, 32.0], [44.0, 31.0],
[38.0, 39.0], [37.0, 54.0], [35.0, 69.0], [36.0, 39.0], [36.0, 28.0], [44.0, 14.0], [44.0, 3.0], [50.0, -30.0], [53.0, -37.0], [53.0, -52.0],
[60.0, -64.0], [62.0, -74.0], [62.0, -83.0], [65.0, -89.0], [62.0, -103.0], [69.0, -118.0], [77.0, -119.0], [80.0, -125.0], [80.0, -128.0],
[84.0, -137.0], [83.0, -151.0], [78.0, -164.0], [80.0, -177.0], [80.0, -209.0], [82.0, -233.0], [85.0, -245.0], [85.0, -246.0], [81.0, -250.0],
[87.0, -263.0], [94.0, -264.0], [101.0, -263.0], [104.0, -263.0], [103.0, -269.0], [97.0, -275.0], [104.0, -289.0], [112.0, -292.0], [128.0, -291.0],
[158.0, -292.0], [170.0, -293.0], [175.0, -295.0], [174.0, -303.0], [165.0, -313.0], [147.0, -323.0], [131.0, -330.0], [116.0, -331.0], [103.0, -333.0],
[100.0, -340.0], [108.0, -344.0], [107.0, -353.0], [105.0, -359.0], [98.0, -364.0], [85.0, -358.0], [80.0, -348.0], [82.0, -341.0], [86.0, -338.0],
[90.0, -335.0], [91.0, -331.0], [58.0, -324.0], [-2.0, -319.0], [-49.0, -314.0], [-59.0, -321.0], [-57.0, -329.0], [-55.0, -333.0], [-56.0, -340.0],
[-64.0, -344.0], [-78.0, -345.0], [-83.0, -335.0], [-82.0, -328.0], [-79.0, -321.0], [-72.0, -319.0], [-67.0, -315.0], [-79.0, -313.0], [-98.0, -310.0],
[-119.0, -299.0], [-133.0, -286.0], [-135.0, -278.0], [-132.0, -272.0], [-126.0, -266.0], [-119.0, -264.0], [-105.0, -264.0], [-93.0, -268.0],
[-82.0, -270.0], [-76.0, -271.0], [-71.0, -273.0], [-70.0, -270.0], [-68.0, -255.0], [-70.0, -244.0], [-71.0, -231.0], [-64.0, -215.0], [-66.0, -205.0],
[-68.0, -196.0], [-72.0, -185.0], [-76.0, -177.0], [-76.0, -167.0], [-78.0, -161.0], [-75.0, -151.0], [-73.0, -133.0], [-69.0, -121.0], [-76.0, -117.0],
[-76.0, -109.0], [-73.0, -99.0], [-79.0, -87.0], [-86.0, -79.0], [-92.0, -69.0], [-92.0, -53.0], [-90.0, -35.0], [-94.0, -26.0], [-91.0, -16.0],
[-91.0, 1.0], [-88.0, 13.0], [-86.0, 26.0], [-90.0, 32.0], [-90.0, 38.0], [-85.0, 45.0], [-85.0, 47.0], [-97.0, 45.0], [-102.0, 3.0], [-99.0, -8.0],
[-95.0, -13.0], [-94.0, -18.0], [-93.0, -26.0], [-93.0, -33.0], [-94.0, -38.0], [-96.0, -41.0], [-95.0, -45.0], [-101.0, -41.0], [-105.0, -32.0],
[-107.0, -22.0], [-108.0, -27.0], [-109.0, -33.0], [-107.0, -38.0], [-105.0, -41.0], [-104.0, -46.0], [-100.0, -48.0], [-98.0, -50.0], [-96.0, -51.0],
[-94.0, -55.0], [-97.0, -56.0], [-102.0, -53.0], [-108.0, -50.0], [-113.0, -43.0], [-118.0, -34.0], [-121.0, -25.0], [-117.0, -9.0], [-115.0, -0.0],
[-118.0, 14.0], [-118.0, 30.0], [-117.0, 46.0], [-121.0, 62.0], [-126.0, 64.0], [-126.0, 72.0], [-124.0, 75.0], [-128.0, 81.0], [-126.0, 92.0],
[-127.0, 106.0], [-123.0, 110.0], [-123.0, 124.0], [-115.0, 125.0], [-111.0, 121.0], [-111.0, 128.0], [-111.0, 137.0], [-113.0, 139.0], [-109.0, 154.0],
[-105.0, 168.0], [-105.0, 182.0], [-101.0, 201.0], [-98.0, 210.0], [-90.0, 216.0], [-83.0, 221.0], [-74.0, 222.0], [-66.0, 227.0], [-60.0, 229.0],
[-56.0, 231.0], [-50.0, 238.0], [-46.0, 240.0], [-45.0, 244.0], [-45.0, 253.0], [-52.0, 263.0], [-54.0, 277.0], [-55.0, 285.0], [-63.0, 296.0]
]
},
{
"color": "white",
"points": [
[-17.0, -46.0], [-2.0, -81.0], [9.0, -93.0], [14.0, -97.0], [14.0, -113.0], [20.0, -120.0], [24.0, -136.0], [29.0, -137.0], [27.0, -141.0], [35.0, -159.0],
[40.0, -180.0], [40.0, -184.0], [42.0, -187.0], [46.0, -202.0], [45.0, -219.0], [47.0, -230.0], [47.0, -240.0], [49.0, -247.0], [55.0, -256.0], [60.0, -256.0],
[59.0, -262.0], [58.0, -270.0], [58.0, -277.0], [56.0, -284.0], [32.0, -281.0], [9.0, -278.0], [-36.0, -275.0], [-34.0, -265.0], [-33.0, -255.0],
[-28.0, -251.0], [-29.0, -245.0], [-27.0, -238.0], [-28.0, -233.0], [-27.0, -228.0], [-31.0, -223.0], [-29.0, -211.0], [-28.0, -206.0], [-31.0, -203.0],
[-33.0, -197.0], [-33.0, -188.0], [-30.0, -179.0], [-30.0, -168.0], [-28.0, -164.0], [-32.0, -154.0], [-24.0, -151.0], [-11.0, -155.0], [-5.0, -146.0],
[-29.0, -134.0], [-25.0, -127.0], [-22.0, -122.0], [-21.0, -118.0], [-23.0, -110.0], [-17.0, -106.0], [-18.0, -101.0], [-16.0, -92.0], [-16.0, -80.0],
[-20.0, -71.0], [-21.0, -57.0], [-22.0, -48.0], [-17.0, -48.0]
]
}
]
text = [1047, 32, 1076, 1085, 1105, 1084, 32, 1085, 1072, 1088, 1072, 1076, 1078, 1101, 1085, 1100, 1085, 1103, 33]
def draw_filled_polygon(t: RawTurtle, color: str, points: Sequence[List[float]]):
t.penup()
t.goto(*points[-1])
t.pendown()
t.color(color, color)
t.begin_fill()
for p in points:
t.goto(*p)
t.end_fill()
def draw_greeting_text(t: RawTurtle, text: Sequence[int]):
t.penup()
t.goto(0, 400)
t.color("black")
t.write("".join(chr(c) for c in text), align="center", font=("Tahoma", 24, "normal"))
if __name__ == "__main__":
screen = Screen()
screen.delay(40)
t = RawTurtle(screen)
for poly in polygons:
draw_filled_polygon(t, poly["color"], poly["points"])
draw_greeting_text(t, text)
screen.mainloop()