-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
90 lines (76 loc) · 1.59 KB
/
main.py
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import turtle as t
import time
t.tracer(0, 0)
screen = t.Screen()
t.title("GenJutsu")
def cir():
t.home()
t.goto(0,-140)
t.shape('blank')
t.color('black','red')
t.width(4)
t.begin_fill()
t.circle(200)
t.end_fill()
t.penup()
t.left(90)
t.forward(160)
t.right(90)
t.pendown()
t.color('black')
t.begin_fill()
t.circle(40)
t.end_fill()
t.penup()
t.right(90)
t.forward(60)
t.left(90)
t.pendown()
t.width(3)
t.color('grey')
t.circle(100)
class yin():
def __init__(self, turtle):
self.turtle = turtle.clone()
def draw(self, angle, distance):
t.right(angle)
self.turtle.penup()
self.turtle.forward(100)
self.turtle.right(5)
self.turtle.pendown()
self.turtle.color('black','black')
self.turtle.begin_fill()
self.turtle.circle(distance,180)
self.turtle.right(180)
self.turtle.circle(-2*distance,180)
self.turtle.circle(-1*distance,180)
self.turtle.end_fill()
def erase(self):
self.turtle.clear()
def go(self):
self.turtle.goto(0,60)
t.penup()
t.goto(0, 60)
t.pendown()
t.shape("blank")
a = yin(t)
t.right(120)
b = yin(t)
t.right(120)
c = yin(t)
i = 0
for j in [a,b,c]:
j.erase()
try:
while True:
cir()
for j in [a,b,c]:
j.draw(i, 10)
screen.update()
for j in [a,b,c]:
j.go()
j.erase()
time.sleep(0.01)
i+=0.01
except:
print("Thanks for using")