-
Notifications
You must be signed in to change notification settings - Fork 0
/
turtle_pumpkin.py
60 lines (51 loc) · 1.26 KB
/
turtle_pumpkin.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
import turtle
"""This teaches our program how to make triangles
of a color and x,y coordinates we choose
"""
def make_triangle(x, y, color):
turtle.penup()
turtle.goto(x,y)
turtle.begin_fill()
turtle.color(color)
turtle.pendown()
for count in range(3):
turtle.forward(50)
turtle.left(120)
turtle.end_fill()
"""This teaches our program how to make triangles of a color and x,y squares we choose
"""
def make_square(x, y, color):
turtle.penup()
turtle.goto(x,y)
turtle.begin_fill()
turtle.color(color)
turtle.pendown()
for count2 in range(3):
turtle.forward(50)
turtle.left(90)
turtle.end_fill()
turtle.shape("triangle")
turtle.penup()
turtle.goto(0,-150)
turtle.color('#ff6600')
turtle.begin_fill()
turtle.pendown()
turtle.circle(150)
turtle.penup()
turtle.end_fill()
turtle.left(180)
# The Teeth:
make_triangle(-35, -20, '#ffffff')
make_triangle(0, -20, '#ffffff')
make_triangle(35, -20, '#ffffff')
turtle.left(180)
# The Eyes:
make_triangle(-70, 50, '#ffffff')
make_triangle(0, 50, '#ffffff')
# The Stump:
make_square(-20, 125, '#663300')
turtle.penup()
turtle.goto(-100,-185)
turtle.write('Happy Halloween!', None, None, "24pt normal")
turtle.goto(-120,-185)
turtle.left(180)