File tree Expand file tree Collapse file tree 2 files changed +79
-0
lines changed
Expand file tree Collapse file tree 2 files changed +79
-0
lines changed Original file line number Diff line number Diff line change 1+ import turtle as t
2+
3+
4+ def init ():
5+ t .speed (2 )
6+ t .pensize (2 )
7+ t .screensize (480 , 360 )
8+ t .color ('red' , 'red' )
9+
10+
11+ def draw_heart_right ():
12+ t .up ()
13+ t .goto (50 , 50 )
14+ t .pendown ()
15+ t .right (45 )
16+ t .goto (100 , 0 )
17+ t .seth (45 )
18+ t .fd (120 )
19+ t .circle (50 , 225 )
20+
21+
22+ def draw_heart_left ():
23+ t .up ()
24+ t .goto (0 , 0 )
25+ t .down ()
26+ t .seth (45 )
27+ t .fd (120 )
28+ t .circle (50 , 225 )
29+ t .seth (90 )
30+ t .circle (50 , 225 )
31+ t .fd (120 )
32+
33+
34+ def draw_arrow ():
35+ t .up ()
36+ t .seth (0 )
37+ # 羽毛
38+ t .goto (- 210 , 40 )
39+ t .pendown ()
40+ t .goto (- 215 , 44 )
41+ t .goto (- 190 , 49 )
42+ t .goto (- 175 , 46 )
43+ t .up ()
44+
45+ t .goto (- 210 , 40 )
46+ t .pendown ()
47+ t .goto (- 213 , 34 )
48+ t .goto (- 185 , 39 )
49+ t .goto (- 175 , 46 )
50+ t .up ()
51+
52+ # 箭杆
53+ t .pendown ()
54+ t .goto (0 , 80 )
55+ t .penup ()
56+ t .goto (160 , 110 )
57+ t .pendown ()
58+ t .goto (320 , 140 )
59+
60+ # 箭羽
61+ t .left (160 )
62+ t .begin_fill ()
63+ t .fd (10 )
64+ t .left (120 )
65+ t .fd (10 )
66+ t .left (120 )
67+ t .fd (10 )
68+ t .end_fill ()
69+
70+
71+ if __name__ == '__main__' :
72+ init ()
73+ draw_heart_right ()
74+ draw_heart_left ()
75+ draw_arrow ()
76+ t .hideturtle ()
77+ t .done ()
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ Python技术 公众号文章代码库
1313+ [ greedy-snake] ( https://github.com/JustDoPython/python-examples/tree/master/doudou/2020-04-04-greedy-snake ) :贪吃蛇
1414
1515+ [ epidemic-big-screen] ( https://github.com/JustDoPython/python-examples/tree/master/doudou/2020-04-20-epidemic-big-screen ) :疫情数据大屏
16+
17+ + [ 520] ( https://github.com/JustDoPython/python-examples/tree/master/doudou/2020-05-17-520 ) :Python 教你花式表白小姐姐
1618---
1719
1820从小白到工程师的学习之路。
You can’t perform that action at this time.
0 commit comments