Commit adbbeb1c by BellCodeEditor

save project

parent 4c8c6802
Showing with 22 additions and 3 deletions
......@@ -21,24 +21,43 @@ result = func(6)
print(result)
'''
import turtle as t
import random
def tree(n):
if n >= 50:
pen.forward(n)
pen.right(30)
tree(n-10)
pen.left(60)
tree(n-10)
pen.right(30)
pen.up()
pen.backward(n)
pen.down()
pen = t.Turtle()
pen.color('sienna')
w = t.Screen()
w.bgcolor('wheat')
#准备工作
pen.left(90)
pen.up()
pen.backward(150)
pen.down()
pen.forward(100)
#准备工作*2
'''pen.forward(100)
pen.right(30)
pen.forward(50)
pen.up()
pen.backward(30)
pen.left(60)
pen.down()
pen.forward(50)
pen.forward(50)'''
tree(90)
t.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