Commit 4fc06787 by BellCodeEditor

save project

parent 11f18fb3
Showing with 9 additions and 1 deletions
......@@ -3,7 +3,14 @@ import random
def tree(n):
if n>=0:
pen.pensize(n/10)
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.randint(0, 30)
length = random.randint(1,15)
......@@ -15,6 +22,7 @@ def tree(n):
pen.up()
pen.backward(n)
pen.down()
pen = turtle.Turtle()
......
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