Commit 8691f536 by BellCodeEditor

save project

parent e84b8c67
Showing with 9 additions and 2 deletions
import turtle
import random
pen = turtle.Turtle()
pen.color('sienna')
# 画布大小
......@@ -7,7 +7,14 @@ w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦
def tree(n):
if n>=0:
pen.pensize(n/10)
if n<=12:
color_list=['snow','lightcoral']
color=random.randint(color_list)
pen.color(color)
pen.pensize(n/3)
else:
pen.color('sienna')
pen.pensize(n/10)
pen.forward(n)
angle = random.randint(0,30)
length = random.randint(1,15)
......
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