
from turtle import *
from random import *
screensize(800,800,"gray")
pensize(1)
color("black","black")
hideturtle()
speed(0)
tracer(0)
#创造
#移动
def yid(x,y):
penup()
goto( x,y )
pendown()
def 移动(i):
pu()
fd(i)
pd()
#画
def h(l):
fd(l)
def onetree(o,l,e):
yanse = ["pink","red"]
def tree(cengshu,changdu,cuxi):
pensize(cuxi)
h(changdu)
if cengshu>1:
l = randint(25,40)
ll = randint(25,40)
rt(l)
tree(cengshu-1,changdu*randint(4,10)/10,cuxi*0.8)
lt(l+ll)
tree(cengshu-1,changdu*randint(4,10)/10,cuxi*0.8)
rt(ll)
else:
pencolor(yanse[randint(0,1)])
dot(randint(3,7))
pencolor("black")
bk(changdu)
yid(0,-300)
lt(90)
tree(o,l,e)
for i in range(1000):
pu()
goto(randint(0,900),randint(-250,200))
pd()
pencolor(yanse[randint(0,1)])
dot(randint(3,7))
onetree(12,100,10)
done()