-
Notifications
You must be signed in to change notification settings - Fork 37
/
git-logo.py
84 lines (71 loc) · 1.45 KB
/
git-logo.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
import turtle as pen
#This turtle example graphic displays the git logo and does so completely in sequential order
#one could modify this to use functions allowing for code reuse to create the various shapes
#turtle set up
pen.speed(10)
# '#f1502f' hex code for git logo color
pen.pencolor("#f1502f")
pen.pensize("5")
#turtle starting location
pen.penup()
pen.goto(10,-200)
pen.left(45)
#Square with rounded edges
pen.pendown()
pen.fillcolor("#f1502f")
pen.begin_fill()
for i in range(2):
pen.forward(250)
pen.circle(30,90)
pen.forward(250)
pen.circle(30,90)
pen.end_fill()
#set up fill color for interior shapes
pen.penup()
pen.color("white")
pen.fillcolor("white")
#first node
pen.goto(13,-105)
pen.pendown()
pen.begin_fill()
pen.circle(30)
pen.end_fill()
#second node
pen.penup()
pen.goto(100,-20)
pen.pendown()
pen.begin_fill()
pen.circle(30)
pen.end_fill()
#third node
pen.penup()
pen.goto(15,60)
pen.pendown()
pen.begin_fill()
pen.circle(30)
pen.end_fill()
#diagonal line
pen.penup()
pen.goto(60,1)
pen.pendown()
pen.begin_fill()
#creates and fills a rectange to conect the two nodes
for i in range(2):
pen.forward(25)
pen.left(90)
pen.forward(230)
pen.left(90)
pen.end_fill()
#virtical line
pen.penup()
pen.right(45)
pen.goto(-20,-90)
pen.pendown()
pen.begin_fill()
#creates and fills a rectange to conect the two nodes
for i in range(2):
pen.forward(25)
pen.left(90)
pen.forward(180)
pen.left(90)
pen.end_fill()