Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+5 votes

I put in the code for the eyes and I think it's right like the code runs but nothing shows up on my face. :(

asked in CSC201 Spring 2021 by (8 points)

4 Answers

+4 votes
 
Best answer

Hi! there are two different reasons that I can come up with to this problem:

  1. You should check the order of the code in case the eyes were covered (or behind) the face. The order is that what was drawn first in the code would be displayed in the back and what is drawn after would be displayed in the front.
  2. You haven't used the function to draw the eyes to the window. This is why the program still runs even though the eyes disappear.

Hope this helps!!

answered by (8 points)
selected by
+1

Thnaks TK!

+1

It looks like TK's option #2 is your issue. After you create the eyes, you need to include the function to draw each eye. Something like:

leftEye.draw(win)
+2 votes

Can you show a snipit of the code that you did for the eyes that you think isn't working?

answered by (8 points)
0

I don't know how to put a picture in but this is my code

def main():

window = GraphWin('Smiley',500,500)
window.setBackground('lightcyan')
face=Circle(Point(250,275),100)
face.setFill('gold')
face.draw(window)
Leye=Circle(Point(215,240), 10)
Leye.setFill('black')
Reye=Circle(Point(285,240), 10)
Reye.setFill('black')

main()

+2 votes

Have you remembered to set the color?

answered by (8 points)
+1 vote

The order of the drawing is how you order your code so it might be behind your mouth or face
If not, you should check if there is anything wrong with the typing

answered by (8 points)
...