Commit f6a0f2f5 by BellCodeEditor

save project

parent 25b21812
Showing with 9 additions and 18 deletions
......@@ -2,27 +2,18 @@ import turtle
import random
def tree(n):
if n >= 0:
if n <= 12:
yslb = ['snow','lightcoral']
color = random.choice(yslb)
t.color(color)
t.pensize(n / 3)
else:
t.color('sienna')
t.pensize(n / 10)
t.forward(n) #timi,bmfsdcds
a = random.random()
t.right(30 * a)
l = 1.5 * random.random()
tree(n-10*l)
t.left(60*a)
tree(n-10 * l)
t.right(30 * a)
if n >= 10:
t.forward(n)
t.right(30)
tree(n - 10)
t.left(60)
tree(n - 10)
t.right(30)
t.up()
t.backward(n)
t.down()
t.speed(0)
t = turtle.Turtle()
t.color('sienna')
# 画布大小
......
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