-
Notifications
You must be signed in to change notification settings - Fork 0
/
mindstorms.py
49 lines (36 loc) · 872 Bytes
/
mindstorms.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
import turtle
def draw_square(brad):
for i in range(4):
brad.forward(100)
brad.right(90)
def draw_circle(angel):
angel.color('blue')
angel.circle(100)
def draw_triangle(triangle):
for i in range(3):
triangle.forward(100)
triangle.right(120)
def draw_art():
brad = turtle.Turtle()
brad.color('yellow')
for i in range(40):
draw_square(brad)
brad.right(10)
def main():
window = turtle.Screen()
window.bgcolor('red')
tri = turtle.Turtle()
tri.color('blue')
for i in range(50):
draw_triangle(tri)
tri.right(10)
# draw_art()
# brad = turtle.Turtle()
# draw_square(brad)
# angel = turtle.Turtle()
# draw_circle(angel)
# tri = turtle.Turtle()
# draw_triangle(tri)
window.exitonclick()
if __name__ == '__main__':
main()