Commit 155b53e1 by BellCodeEditor

save project

parent 7ba17e11
Showing with 16 additions and 1 deletions
......@@ -3,7 +3,22 @@ import random
def tree(n):
if n >=0:
pen.forward(n)
if n >=12:
color_list=["snow","lightcoral"]
color=random.choice(color_list)
pen.color(color)
pen.pensize(n/3)
else:
pen.color('sienna')
pen.pensize(n / 10)
pen.forward(n)
angle = random.random()
pen.right(30*angle)
lenght = 1.5*random.random()
tree(n-10*lenght)
pen.left(60*angle)
tree(n-10*lenght)
pen.right()
pen.right(30)
tree(n-10)
pen.left(60)
......
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