Commit 58754dae by BellCodeEditor

save project

parent 576b5884
Showing with 31 additions and 0 deletions
import turtle
import random
c = ['pink','white','snow','lightcoral']
def tree(n):
if n >= 10:
if n == 10:
p.color(random.choice(c))
p.pensize(3)
else:
p.color('sienna')
p.pensize(n/10)
j = random.randint(0,30)
chang = random.randint(1,15)
p.forward(n)
p.right(j)
tree(n-10)
p.left(2*j)
tree(n-10)
p.right(j)
p.up()
p.backward(n)
p.down()
p.hideturtle()
p = turtle.Pen()
w = turtle.Screen()
w.bgcolor('wheat')
p.left(90)
p.speed(10)
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