Skip to content

Commit 7ce2ccf

Browse files
author
DirDraggo
committed
Created Happ-Sad-Face-Travis.py
Created Happ-Sad-Face-Travis.py in 2.17
1 parent 8000ccb commit 7ce2ccf

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
speed(0)
2+
penup()
3+
pensize(10)
4+
happy=input("Are you happy? (yes,no): ")
5+
## Make a smile based on 0,0
6+
def make_smile():
7+
setposition(0,-70)
8+
color("black")
9+
pendown()
10+
circle(60,90)
11+
color("yellow")
12+
circle(60,180)
13+
color("black")
14+
circle(60,90)
15+
penup()
16+
## Make a frown based on 0,0
17+
def make_frown():
18+
penup()
19+
setposition(0,-120)
20+
circle(60,90)
21+
color("black")
22+
pendown()
23+
circle(60,180)
24+
penup()
25+
## Makes a circle and fills it
26+
def make_eye():
27+
color("black")
28+
pendown()
29+
begin_fill()
30+
circle(20)
31+
end_fill()
32+
penup()
33+
## navigation
34+
setposition(0,-100)
35+
color("yellow")
36+
pendown()
37+
begin_fill()
38+
circle(100)
39+
end_fill()
40+
penup()
41+
## Code branches to see if `happy` or `sad`
42+
if happy == "yes":
43+
make_smile()
44+
elif happy == "no":
45+
make_frown()
46+
penup()
47+
setposition(0,0)
48+
left(90)
49+
## Final Navigation
50+
setposition(-30,25)
51+
make_eye()
52+
forward(70)
53+
make_eye()

0 commit comments

Comments
 (0)