Commit 957f6e30 by BellCodeEditor

save project

parent bbd0cc77
Showing with 13 additions and 8 deletions
...@@ -8,20 +8,25 @@ ...@@ -8,20 +8,25 @@
# alist[j] , alist[j+1] = alist[j+1] , alist[j] # alist[j] , alist[j+1] = alist[j+1] , alist[j]
# print(alist) # print(alist)
import turtle as t import turtle as t
import random
def tree(n): def tree(n):
if n>=50: if n>=20:
# t.size(n/10)
t.forward(n) t.forward(n)
t.right(30) angle=random.randint(0,30)
tree(n-10) lenght=random.randint(1,15)
t.left(60) t.right(angle)
tree(n-10) tree(n-lenght)
t.right(30) t.left(2*angle)
tree(n-lenght)
t.right(angle)
t.up() t.up()
t.backward(n) t.backward(n)
t.down() t.down()
t.goto(0,0) # t.goto(0,0)
t.left(90) t.left(90)
tree(100) tree(70)
# t.forward(100) # t.forward(100)
# t.left(30) # t.left(30)
# t.forward(50) # t.forward(50)
......
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