Commit 7448da1d by BellCodeEditor

save project

parent c2e5703f
Showing with 11 additions and 6 deletions
import turtle
import random
p = turtle.Pen()
p.color('sienna')
turtle.Screen().bgcolor('wheat')
......@@ -9,15 +10,18 @@ p.hideturtle()
p.speed(11)
def tree(size):
if size >= 0:
p.pensize(size/10)
length = random.randint(1,20)
angle = random.randint(5,30)
p.forward(size)
p.left(30)
tree(size-20)
p.right(60)
tree(size-20)
p.left(30)
p.left(angle)
tree(size-length)
p.right(angle*2)
tree(size-length)
p.left(angle)
p.penup()
p.backward(size)
p.pendown()
tree(100)
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