Commit 69ceaf9a by BellCodeEditor

save project

parent e79bf956
Showing with 8 additions and 2 deletions
...@@ -6,7 +6,7 @@ pen.color('sienna') ...@@ -6,7 +6,7 @@ pen.color('sienna')
# 画布大小 # 画布大小
w = turtle.Screen() w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦 w.bgcolor('wheat') # wheat小麦
pen.speed(0)
# 移动到起点 # 移动到起点
pen.left(90) pen.left(90)
pen.up() pen.up()
...@@ -30,7 +30,13 @@ pen.down() ...@@ -30,7 +30,13 @@ pen.down()
# pen.down() # pen.down()
def tree(n): def tree(n):
if n>=0: if n>=0:
pen.pensize(n/10) if n<=12:
pen_list=["snow","lightcoral"]
pen.pensize(n/3)
pen.pencolor(random.choice(pen_list))
else:
pen.pencolor("sienna")
pen.pensize(n/10)
pen.forward(n) pen.forward(n)
angle=random.randint(0,30) angle=random.randint(0,30)
length = random.randint(1,15) length = random.randint(1,15)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment