Commit 53ec9c69 by BellCodeEditor

save project

parent 26f9e202
Showing with 7 additions and 1 deletions
import turtle import turtle
import random import random
cs=["snow","lightcoral"]
pen = turtle.Turtle() pen = turtle.Turtle()
pen.color('sienna') pen.color('sienna')
pen.speed(0) pen.speed(0)
...@@ -15,7 +16,12 @@ pen.down() ...@@ -15,7 +16,12 @@ pen.down()
def tree(n): def tree(n):
if n<1: if n<1:
return return
pen.pensize(n/10) elif n<=12:
pen.color(random.choice(cs))
pen.pensize(n/3)
else:
pen.color("sienna")
pen.pensize(n/5)
pen.forward(n) pen.forward(n)
angle=random.randint(0,30) angle=random.randint(0,30)
length=random.randint(0,15) length=random.randint(0,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