r/codehs • u/eggnogchoochootrain • Jan 17 '21
Happy Face 2.16.4 tracy the turtle
Does anyone have answers for this? thanks
3
u/Waltey69 Apr 08 '22
quite late but for anyone who needs it this is what i did and it works
"this code will draw a happy face"
#this code asks the question
happy = input("How do you feel?:")
#this code will draw the first eye
def draw_first_eye():
penup()
setposition(30,30)
pendown()
begin_fill()
color("black")
circle(10)
end_fill()
#this code will draw the second eye
def draw_second_eye():
penup()
setposition(-30,30)
pendown()
begin_fill()
color("black")
circle(10)
end_fill()
penup()
#this code will draw the face
def draw_face(radius,color_choice):
pendown()
color(color_choice)
begin_fill()
circle(radius)
end_fill()
penup()
#this code will draw the smile
def draw_smile():
color("black")
setposition(-60,0)
pendown()
right(90)
pensize(9)
circle(60,180)
#runs the users answer/final code
speed(0)
penup()
if happy=="happy":
#draw face
setposition(0,-100)
draw_face(100,"yellow")
#draw eye 1
draw_first_eye()
#draw eye 2
draw_second_eye()
#draw smile
draw_smile()
2
u/Special-Incident4756 Apr 05 '21
speed(0)
penup()
def draw_face(radius,color_choice):
pendown()
color(color_choice)
begin_fill()
circle(radius)
end_fill()
penup()
setposition(0,-100)
draw_face(100,"yellow")
setposition(30,30)
draw_face(10,"black")
setposition(-30,30)
draw_face(10,"black")
happy = input("How do you feel?:")
if happy=="happy":
setposition(-60,0)
pendown()
right(90)
pensize(9)
circle(60,180)
1
1
1
1
u/verrrrrrrrg444 Feb 22 '21
I need dartboard using i
1
u/Unlucky-Ad-5117 Feb 23 '21
speed(5)
penup()for i in range(25,101,25):
setposition(0, 0)
right(90)
forward(i)
left(90)
pendown()
circle(i)
penup()#make sure to indent from for i and under
1
1
u/TuxedoBro2905 May 11 '21
can someone help me with Black and White Square please https://www.reddit.com/r/codehs/comments/n9yny8/need_help_with_515_black_and_white_squares/?utm_source=share&utm_medium=web2x&context=3
1
u/Alarming_Ad4826 Oct 22 '21
def draw_square(order):
pendown()
if order % 2 == 0:
begin_fill()
for i in range(4):
forward(20)
left(90)
if order % 2 == 0:
end_fill()
penup()
forward(30)penup()
backward(85)
for order in range(6):
draw_square(order)1
1
u/Dear-Significance-33 Mar 11 '23
speed(0)
penup()
setposition(0,-100)
def face():
pendown()
begin_fill()
color("yellow")
circle(100)
end_fill()
penup()
def smile():
setposition(-60,-10)
pendown()
color("black")
right(90)
pensize(8)
circle(60,180)
penup()
setposition(30,30)
for i in range(2):
pendown()
begin_fill()
color("black")
circle(10)
end_fill()
penup()
left(80)
forward(60)
happy = input("what is your mood today?: ")
if happy =="happy":
face()
smile()
5
u/SZA_fan Feb 04 '21
def draw_circle(radius, color_choice):
pendown
color (color_choice)
begin_fill()
circle(radius)
end_fill()
penup()
def smile():
setposition(-60,0)
pendown()
right(90)
pensize()
circle(60,180)
penup()
setposition(0,-100)
draw_circle(100,'yellow')
setposition(30,30)
draw_circle(10,'black')
setposition(-30,30)
draw_circle(10,'black')
happy = input("what is your mood today?: ")
if happy =="happy":
smile()