Commit 17de45f4 by BellCodeEditor

auto save

parent 251b0273
Showing with 4 additions and 3 deletions
import turtle import turtle
import random import random
def tree(n): def tree(n):
if n >= 10: if n > 10:
if n<=12: if n<=12:
color_list=['snow','lightcoral'] color_list=['snow','lightcoral']
color = random.choice(color_list) color = random.choice(color_list)
...@@ -24,7 +24,7 @@ def tree(n): ...@@ -24,7 +24,7 @@ def tree(n):
pen = turtle.Turtle() pen = turtle.Turtle()
pen.color('sienna') pen.color('sienna')
pen.speed(30) pen.speed(20)
# 画布大小 # 画布大小
w = turtle.Screen() w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦 w.bgcolor('wheat') # wheat小麦
...@@ -35,6 +35,6 @@ pen.up() ...@@ -35,6 +35,6 @@ pen.up()
pen.backward(150) # 后退 pen.backward(150) # 后退
pen.down() pen.down()
tree(65) tree(60)
turtle.down turtle.down
\ No newline at end of file
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