Commit fcf1dd9a by BellCodeEditor

save project

parent fc483c0c
Showing with 11 additions and 4 deletions
......@@ -3,9 +3,8 @@ import random
pen = turtle.Turtle()
pen.color('sienna')
# 画布大小
pen.pensize(6)
w = turtle.Screen()
w.bgcolor('black')
w.bgcolor('wheat')
# 移动到起点
pen.left(90)
......@@ -15,6 +14,16 @@ pen.down()
def tree(n):
if n>=0:
if n<=12:
list=["snow","lightcoral"]
g=random.choice(list)
pen.pencolor(g)
pen.pensize=(n/3)
else:
pen.pencolor("sienna")
a=random.randint(0,30)
b=random.randint(0,15)
pen.forward(n)
......@@ -27,5 +36,4 @@ def tree(n):
pen.backward(n)
pen.pendown()
tree(60)
turtle.done()
\ No newline at end of file
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