Skip to content

Commit 6139c66

Browse files
committed
add code
1 parent 1fba343 commit 6139c66

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

doudou/2020-05-17-520/love.py

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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()

doudou/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
从小白到工程师的学习之路。

0 commit comments

Comments
 (0)