-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFile.py
More file actions
72 lines (69 loc) · 1.48 KB
/
File.py
File metadata and controls
72 lines (69 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import turtle as tur
tur.speed(0)
tur.color("#4d1919")
tur.width(5)
def go_to_pos(x,y):
tur.penup()
tur.goto(x,y)
tur.pendown()
def leaf(x):
tur.width(1)
tur.forward(20)
tur.right(60)
tur.begin_fill()
tur.fillcolor("green")
tur.circle(x/2,90)
tur.forward(x/2)
tur.left(127)
tur.forward(x/2)
tur.circle(x/2,90)
tur.end_fill()
tur.left(115)
tur.width(0.1)
tur.forward(x)
tur.color("#bfff00")
for i in range(4):
tur.backward(x/4)
tur.width(2/(4-i))
tur.left(30)
tur.forward(x/(7-i))
tur.backward(x/(7-i))
tur.right(60)
tur.forward(x / (7 - i))
tur.backward(x / (7 - i))
tur.left(30)
tur.width(5)
tur.color("#4d1919")
tur.backward(20)
def branches():
for b in range(3):
tur.seth(30*(b+1))
go_to_pos(0,-250)
n=12
for i in range(n):
angle = 45 if i%2 else -45
tur.circle(500,4)
tur.right(angle)
leaf(80+((n-i)*2))
tur.left(angle)
leaf(80)
def pot():
go_to_pos(2,-250)
tur.seth(-90)
tur.width(10)
tur.begin_fill()
tur.forward(30)
tur.seth(0)
tur.forward(30)
tur.seth(-100)
tur.forward(40)
tur.seth(180)
tur.forward(50)
tur.seth(100)
tur.forward(40)
tur.seth(0)
tur.forward(30)
tur.end_fill()
branches()
pot()
tur.done()