-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathmain4.py
45 lines (42 loc) · 929 Bytes
/
main4.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
import turtle
t = turtle.Turtle()
screen = turtle.Screen()
screen.screensize(600,500)
screen.bgcolor('black')
turtle.colormode(255)
t.ht()
t.speed(50)
x = 50
r = 254
g = 0
b = 0
t.penup()
# t.goto(-400, -250)
t.pendown()
while x < 1000:
tup = (r, g, b)
t.pencolor(tup)
for i in range(20):
if r == 254 and g < 254 and b == 0:
g += 2
elif r > 0 and g == 254 and b == 0:
r -= 2
elif r == 0 and g == 254 and b < 254:
b += 2
elif r == 0 and g > 0 and b == 254:
g -= 2
elif r < 254 and g == 0 and b == 254:
r += 2
elif r == 254 and g == 0 and b > 0:
b -= 2
# t.fd(x/5)
for j in range(2):
t.circle(x, 90)
t.circle(x // 3,90)
x = x + 1
t.penup()
t.goto(0, 0)
print(x)
t.right(5)
t.pendown()
turtle.done()