Commit d8dfc649 by BellCodeEditor

save project

parent 7448da1d
Showing with 14 additions and 4 deletions
......@@ -3,15 +3,24 @@ import random
p = turtle.Pen()
p.color('sienna')
turtle.Screen().bgcolor('wheat')
p.sety(-50)
p.penup()
p.sety(-150)
p.left(90)
p.pensize(5)
p.hideturtle()
p.speed(11)
p.pendown()
def tree(size):
if size >= 0:
p.pensize(size/10)
length = random.randint(1,20)
if size >= 15:
p.pencolor('sienna')
p.pensize(size/10)
else:
p.pensize(size/3)
colors = ['snow','lightcoral']
color = colors[random.randint(0,1)]
p.pencolor(color)
length = random.randint(5,20)
angle = random.randint(5,30)
p.forward(size)
p.left(angle)
......@@ -23,5 +32,5 @@ def tree(size):
p.backward(size)
p.pendown()
tree(60)
tree(80)
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