Commit 0348f160 by BellCodeEditor

save project

parent 5e7b4fe6
Showing with 14 additions and 10 deletions
import turtle
def tree(n):
if n>=0:
pen.forward(50)
pen.right(30)
tree(n-10)
pen.left(60)
tree(n-10)
pen.right(30)
pen.up()
pen.backward(50)
pen.down()
pen = turtle.Turtle()
pen.color('sienna')
turtle.left(90)
turtle.forward(50)
turtle.right(30)
turtle.forward(30)
turtle.penup()
turtle.backward(30)
turtle.left(60)
turtle.pendown()
turtle.forward(30)
w = turtle.Screen()
w.bgcolor('wheat')
......@@ -24,5 +28,5 @@ pen.left(90)
pen.up()
pen.backward(150) # 后退
pen.down()
tree(60)
turtle.done()
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