Commit f2b98f66 by BellCodeEditor

save project

parent a8207343
Showing with 9 additions and 7 deletions
import turtle import turtle
i import random
pen = turtle.Turtle() pen = turtle.Turtle()
pen.color('sienna') pen.color('sienna')
# 画布大小 # 画布大小
w = turtle.Screen() w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦 w.bgcolor('wheat') # wheat小麦
def a(n): def a(n):
if n>=30: if n>=0:
b=random.random()
c=1.5*b
turtle.forward(n) turtle.forward(n)
turtle.right(30) turtle.right(30*b)
a(n-10) a(n-10*c)
turtle.left(60) turtle.left(30*2*b)
a(n-10) a(n-10*c)
turtle.right(30) turtle.right(30*b)
turtle.up() turtle.up()
turtle.backward(n) turtle.backward(n)
turtle.down() turtle.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