Commit 29780eba by BellCodeEditor

auto save

parent a3cf296d
Showing with 6 additions and 6 deletions
import turtle
import random
pen = turtle.Turtle()
pen.color('sienna')
# 画布大小
w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦
w.bgcolor('wheat')
def tree(n):
if n>=50:
pen.forward(n)
pen.right(30)
angle = random.randint(0,30)
pen.right(angle)
tree(n-10)
pen.left(30)
pen.left(30)
pen.left(2*angle)
tree(n-10)
pen.right(30)
pen.right(angle)
pen.up()
pen.backward(n)
pen.down()
......
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