shanshuo.py
1.35 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
import turtle
import random
import time
import threading
turtle.colormode(255)
t1 = turtle.Turtle()
t2 = turtle.Turtle()
t1.hideturtle()
t1.pensize(0)
t1.pencolor(255,255,255)
t2.hideturtle()
t2.pensize(0)
t2.pencolor(255,255,255)
def wait():
time.sleep(0.5)
def move1():
# turtle.tracer(False)
while True:
t1.speed(0)
t1.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t1.begin_fill()
for i in range(5):
t1.forward(100)
t1.right(144)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t1.end_fill()
def move2():
t2.goto(100,100)
# turtle.tracer(False)
for i in range(5):
t2.speed(0)
t2.fillcolor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
t2.begin_fill()
for i in range(5):
t2.forward(100)
t2.right(144)
# for i in range(500):
# print("")
# turtle.reset()
wait()
t2.end_fill()
# for i in range(5):
# move()
# time.sleep(1000)
# move1()
# move2()
thread1 = threading.Thread(target=move1)
thread2 = threading.Thread(target=move2)
thread1.start()
thread2.start()
turtle.mainloop()