-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patholympicrings.py
63 lines (50 loc) · 1.02 KB
/
olympicrings.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
#Turtle Art Olympic Rings
#November 26, 2016
#Import Zone----
import turtle
#---------------
#Variables----------------
length = (50)
turn =(90)
michael = turtle.Turtle()
#--------------------------
#Function to make a circle
def circle(michael):
michael.circle(length,360)
#Function to make turtle to move to the next ring
def move(michael):
michael.pu()
michael.right(turn)
michael.forward(length * 2.25)
michael.left(turn)
michael.pd()
#Function to make turtle move to next row
def nextrow(michael):
michael.pu()
michael.left(turn)
michael.forward(length * 1.125 * 2 + length)
michael.left(turn)
michael.forward(length * 1)
michael.right(turn * 2)
michael.pd()
michael.left(turn)
#Blue Ring
michael.color('#0000FF')
circle(michael)
move(michael)
#Black Ring
michael.color('#000000')
circle(michael)
move(michael)
#Red Ring
michael.color('#ff0000')
circle(michael)
#Yellow Ring
michael.color('#ffff00')
nextrow(michael)
circle(michael)
move(michael)
#Green Ring
michael.color('#008000')
circle(michael)
turtle.done()