Skip to content

Commit b3b9410

Browse files
committed
update code
1 parent 3efd6e7 commit b3b9410

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

chaoxi/2020-03-24-cherry_tree/cherry_tree.py renamed to chaoxi/2020-03-24-flower/flower_tree.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
def cherryTree(branch, t):
55
if branch > 4:
6+
# 枝干数
67
if 7 <= branch <= 13:
78
# 随机数生成
89
if random.randint(0, 3) == 0:
@@ -15,8 +16,8 @@ def cherryTree(branch, t):
1516
if random.randint(0, 2) == 0:
1617
t.color('snow')
1718
else:
18-
# 设置樱花树叶颜色
19-
t.color('green') # 樱花树颜色
19+
# 设置树叶颜色
20+
t.color('green')
2021
t.pensize(branch / 5)
2122
else:
2223
t.color('Peru') # 树干颜色
@@ -63,18 +64,18 @@ def petal(m, t):
6364
def des_word():
6465
t.color('LightCoral') # 字体颜色设置
6566
t.hideturtle()
66-
t.goto(-50,-130)
67+
# t.goto(-50, -130)
68+
t.goto(-60,-170)
6769
t.pu()
68-
# 昨日雪如花,今日花如雪,山樱如美人,红颜易消歇。
69-
t.write('昨日雪如花,',move=False, align='center', font=('Arial', 20, 'normal'))
70+
t.write('姹紫嫣红桃花笺,',move=False, align='center', font=('Arial', 20, 'normal'))
7071
t.pd()
7172

7273
t.pu()
73-
t.goto(90,-130)
74-
t.write('今日花如雪', move=False, align='center', font=('Arial', 20, 'normal'))
74+
# t.goto(90, 130)
75+
t.goto(150,-170)
76+
t.write('繁花似锦为君妍', move=False, align='center', font=('Arial', 20, 'normal'))
7577
t.pd()
7678

77-
7879
# 绘图区域
7980
t = turtle.Turtle()
8081
# 画布大小 获取到屏幕

0 commit comments

Comments
 (0)