heres a virtual dog program
15 years ago
heres a fun lil program that, if you have a python reading program, you can play around with that i made :)
be sure to have a grahics mod in the file you save this to
from graphics import *
def main():
"""dog drawing program"""
win = GraphWin("CS1400 - Pet Dog", 610, 500) # create graphics window
clear_screen(win) # start with a clear screen
rec1, rec2, rec3, rec4 = draw_buttons(win) # create user buttons
mood = MOOD_HAPPY
# loop forever until dog is dead
while True:
drawDogMood(win, mood)
mouseClick = win.getMouse() # get mouse click
action = getAction (rec1, rec2, rec3, rec4, mouseClick)
mood = setMood (action, mood)
if mood == MOOD_DEAD:
drawDogMood(win, mood)
break
# wait for user to click one more time before ending the program
msg_location = Point(305, 430)
msg = Text(msg_location, "ZOMBIE DOG! Click anywhere to run.")
msg.setTextColor("red")
msg.draw(win) # draw message
mouseClick = win.getMouse()
win.close()
return
ACTION_PET = 1
ACTION_FEED = 2
ACTION_PLAY = 3
ACTION_IGNOR = 4
ACTION_ERROR = 5
MOOD_HAPPY = 1
MOOD_ANGRY = 2
MOOD_SLEEPING = 3
MOOD_BORED = 4
MOOD_HUNGRY = 5
MOOD_DEAD = 6
def happyAction (action):
new_mood = MOOD_HAPPY
if action == ACTION_PLAY:
new_mood = MOOD_HUNGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_BORED
elif action == ACTION_PET:
new_mood = MOOD_SLEEPING
elif action == ACTION_FEED:
new_mood = MOOD_SLEEPING
return new_mood
def sleepingAction (action):
new_mood = MOOD_SLEEPING
if action == ACTION_PLAY:
new_mood = MOOD_ANGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_BORED
elif action == ACTION_PET:
new_mood = MOOD_ANGRY
elif action == ACTION_FEED:
new_mood = MOOD_SLEEPING
return new_mood
def angryAction (action):
new_mood = MOOD_ANGRY
if action == ACTION_PLAY:
new_mood = MOOD_HUNGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_ANGRY
elif action == ACTION_PET:
new_mood = MOOD_SLEEPING
elif action == ACTION_FEED:
new_mood = MOOD_BORED
return new_mood
def boredAction (action):
new_mood = MOOD_BORED
if action == ACTION_PLAY:
new_mood = MOOD_HUNGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_SLEEPING
elif action == ACTION_PET:
new_mood = MOOD_HAPPY
elif action == ACTION_FEED:
new_mood = MOOD_BORED
return new_mood
def hungryAction (action):
new_mood = MOOD_HUNGRY
if action == ACTION_PLAY:
new_mood = MOOD_ANGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_DEAD
elif action == ACTION_PET:
new_mood = MOOD_HUNGRY
elif action == ACTION_FEED:
new_mood = MOOD_SLEEPING
return new_mood
def setMood (action, mood):
new_mood = mood
if mood == MOOD_HAPPY:
new_mood = happyAction (action)
elif mood == MOOD_HUNGRY:
new_mood = hungryAction (action)
elif mood == MOOD_BORED:
new_mood = boredAction (action)
elif mood == MOOD_ANGRY:
new_mood = angryAction (action)
elif mood == MOOD_SLEEPING:
new_mood = sleepingAction (action)
return new_mood
def getAction (rec1, rec2, rec3, rec4, mouseClick):
if inBox(rec1, mouseClick):
return ACTION_PET
elif inBox(rec2, mouseClick):
return ACTION_FEED
elif inBox(rec3, mouseClick):
return ACTION_PLAY
elif inBox(rec4, mouseClick):
return ACTION_IGNOR
else:
return ACTION_ERROR
def drawDogMood (win, mood):
if mood == 1:
drawHappy(win)
elif mood == 2:
drawAngry(win)
elif mood == 3:
drawSleeping(win)
elif mood == 4:
drawBored(win)
elif mood == 5:
drawHungry(win)
elif mood == 6:
drawDead(win)
def clear_screen(win):
# overwrite the screen with a blank rectangle (clears the screen)
rec=Rectangle(Point(10,10),Point(600,440))
rec.setFill("white")
rec.draw(win)
# create the buttons at the bottom of the screen
def draw_buttons(win):
# draw line at bottom of screen
line1 = Line(Point(10,440),Point(600,440))# create line
line1.draw(win) # draw it
# draw the 6 buttons at the bottom of the screen
rec1 = drawRec(win, Point(5,450), Point(150,490), 'green', 'Pet')
rec2 = drawRec(win, Point(160,450), Point(300,490), 'green', 'Feed')
rec3 = drawRec(win, Point(310,450), Point(460,490), 'green', 'Play')
rec4 = drawRec(win, Point(470,450), Point(610,490), 'green', 'Ignor')
return rec1, rec2, rec3, rec4
# function to draw a button
# parameters: win - Window to draw in (GraphWin object)
# recTop - Top corner of button (Point object)
# recBot - Bottom corner of button (Point object)
# color - Color of button (string or Color object)
# mood - Text of button (string)
#
# return: a list of these paramters so we can save them of later use
def drawRec(win, recTop, recBot, color, mood):
"""(top corner, bottom corner, color, mood)"""
rec = Rectangle(recTop,recBot)# create rectangle
rec.setFill(color) # set fill color
rec.draw(win) # draw it
label = Text(Point((recTop.getX()+recBot.getX())/2,(recBot.getY()+recTop.getY())/2),mood)
label.draw(win) # draw label
return [recTop,recBot,color]
# function to determine of mouse click is in button box
# parameters: rec - The rectangle of the button box
# click - The Point coordinates of the mouse click
#
# return: True - If click is in the rectangle
# False - If click is NOT in the rectangle
def inBox(rec, click):
"""(rec, click) checks if click in rec"""
recTop = rec[0]
recBot = rec[1]
if (click.getX() > recTop.getX()) and (click.getX()< recBot.getX()):
if (click.getY() > recTop.getY()) and (click.getY() < recBot.getY()):
return True
return False
#
# Place your shared functions here so they can be used by the
# draw mood functions.
#
def drawbody(win):
lear = Oval (Point(175,125), Point(250,400))
lear.setFill('tan')
lear.setOutline('tan')
rear = Oval (Point (425,125), Point (350,400))
rear.setFill('tan')
rear.setOutline('tan')
head = Circle (Point (300,200), 100)
head.setFill('brown')
head.setOutline('brown')
nose = Polygon (Point (275,225), Point (325,225), Point (300,250))
nose.setFill('black')
lear.draw(win)
rear.draw(win)
head.draw(win)
nose.draw(win)
# draw happy dog (Place your code here)
def drawHappy(win):
"""draws happy dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('white')
leye.setOutline('white')
leyecolor = Circle (Point (250,175), 15)
leyecolor.setFill('blue')
leyecolor.setOutline('blue')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('white')
reye.setOutline('white')
reyecolor = Circle (Point (350,175), 15)
reyecolor.setFill('Blue')
reyecolor.setOutline('blue')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
happymouth = Polygon (Point (275,265), Point (325,265), Point (325,275), Point (315,290), Point (285,290), Point (275,275))
happymouth.setFill('black')
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
happymouth.draw(win)
# draw angry dog (Place your code here)
def drawAngry(win):
"""draws angry dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('white')
leye.setOutline('white')
leyecolor = Circle (Point (250,175), 15)
leyecolor.setFill('red')
leyecolor.setOutline('red')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('white')
reye.setOutline('white')
reyecolor = Circle (Point (350,175), 15)
reyecolor.setFill('red')
reyecolor.setOutline('red')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
mad = Polygon (Point (250,130), Point (350,130), Point (325,175), Point (275,175))
mad.setFill('brown')
mad.setOutline('brown')
teeth = Polygon (Point (250,265), Point (350,265), Point (338,245), Point (326,265), Point (314,245), Point (302,265), Point (290,245), Point (278,265), Point (266,245), Point (254,265))
teeth.setFill('white')
teeth.setOutline('white')
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
mad.draw(win)
teeth.draw(win)
# draw sleeping dog (Place your code here)
def drawSleeping(win):
"""draws sleeping dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('brown')
reye = Circle (Point (350,175), 25)
reye.setFill('brown')
sleepingmouth = Circle (Point (300,275), 10)
sleepingmouth.setFill('black')
leye.draw(win)
reye.draw(win)
sleepingmouth.draw(win)
# draw bored dog (Place your code here)
def drawBored(win):
"""draws bored dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('white')
leye.setOutline('white')
leyecolor = Circle (Point (250,175), 15)
leyecolor.setFill('blue')
leyecolor.setOutline('blue')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('white')
reye.setOutline('white')
reyecolor = Circle (Point (350,175), 15)
reyecolor.setFill('Blue')
reyecolor.setOutline('blue')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
bored = Rectangle(Point (220,145), Point (375,165))
bored.setFill('brown')
bored.setOutline('brown')
bm = Polygon (Point (275,275), Point (325,275))
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
bored.draw(win)
bm.draw(win)
# draw hungry dog (Place your code here)
def drawHungry(win):
"""draws hungry dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('white')
leye.setOutline('white')
leyecolor = Circle (Point (250,175), 20)
leyecolor.setFill('blue')
leyecolor.setOutline('blue')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('white')
reye.setOutline('white')
reyecolor = Circle (Point (350,175), 20)
reyecolor.setFill('Blue')
reyecolor.setOutline('blue')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
sad = Rectangle(Point (220,187), Point (390,205))
sad.setFill('brown')
sad.setOutline('brown')
feed = Oval (Point (275,265), Point (325,285))
feed.setFill('black')
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
sad.draw(win)
feed.draw(win)
# draw dead dog (Place your code here)
def drawDead(win):
"""draws dead dog"""
clear_screen(win)
lear = Oval (Point(175,125), Point(250,400))
lear.setFill('tan4')
lear.setOutline('tan4')
rear = Oval (Point (425,125), Point (350,400))
rear.setFill('tan4')
rear.setOutline('tan4')
head = Circle (Point (300,200), 100)
head.setFill('brown4')
head.setOutline('brown4')
nose = Polygon (Point (275,225), Point (325,225), Point (300,250))
nose.setFill('black')
leye = Circle (Point (250,175), 25)
leye.setFill('yellow')
leye.setOutline('yellow')
leyecolor = Circle (Point (250,175), 15)
leyecolor.setFill('green')
leyecolor.setOutline('green')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('yellow')
reye.setOutline('yellow')
reyecolor = Circle (Point (350,175), 15)
reyecolor.setFill('green')
reyecolor.setOutline('green')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
teeth = Polygon (Point (250,265), Point (350,265), Point (338,245), Point (326,265), Point (314,245), Point (302,265), Point (290,245), Point (278,265), Point (266,245), Point (254,265))
teeth.setFill('white')
teeth.setOutline('white')
lear.draw(win)
rear.draw(win)
head.draw(win)
nose.draw(win)
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
teeth.draw(win)
# run main loop
main()
be sure to have a grahics mod in the file you save this to
from graphics import *
def main():
"""dog drawing program"""
win = GraphWin("CS1400 - Pet Dog", 610, 500) # create graphics window
clear_screen(win) # start with a clear screen
rec1, rec2, rec3, rec4 = draw_buttons(win) # create user buttons
mood = MOOD_HAPPY
# loop forever until dog is dead
while True:
drawDogMood(win, mood)
mouseClick = win.getMouse() # get mouse click
action = getAction (rec1, rec2, rec3, rec4, mouseClick)
mood = setMood (action, mood)
if mood == MOOD_DEAD:
drawDogMood(win, mood)
break
# wait for user to click one more time before ending the program
msg_location = Point(305, 430)
msg = Text(msg_location, "ZOMBIE DOG! Click anywhere to run.")
msg.setTextColor("red")
msg.draw(win) # draw message
mouseClick = win.getMouse()
win.close()
return
ACTION_PET = 1
ACTION_FEED = 2
ACTION_PLAY = 3
ACTION_IGNOR = 4
ACTION_ERROR = 5
MOOD_HAPPY = 1
MOOD_ANGRY = 2
MOOD_SLEEPING = 3
MOOD_BORED = 4
MOOD_HUNGRY = 5
MOOD_DEAD = 6
def happyAction (action):
new_mood = MOOD_HAPPY
if action == ACTION_PLAY:
new_mood = MOOD_HUNGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_BORED
elif action == ACTION_PET:
new_mood = MOOD_SLEEPING
elif action == ACTION_FEED:
new_mood = MOOD_SLEEPING
return new_mood
def sleepingAction (action):
new_mood = MOOD_SLEEPING
if action == ACTION_PLAY:
new_mood = MOOD_ANGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_BORED
elif action == ACTION_PET:
new_mood = MOOD_ANGRY
elif action == ACTION_FEED:
new_mood = MOOD_SLEEPING
return new_mood
def angryAction (action):
new_mood = MOOD_ANGRY
if action == ACTION_PLAY:
new_mood = MOOD_HUNGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_ANGRY
elif action == ACTION_PET:
new_mood = MOOD_SLEEPING
elif action == ACTION_FEED:
new_mood = MOOD_BORED
return new_mood
def boredAction (action):
new_mood = MOOD_BORED
if action == ACTION_PLAY:
new_mood = MOOD_HUNGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_SLEEPING
elif action == ACTION_PET:
new_mood = MOOD_HAPPY
elif action == ACTION_FEED:
new_mood = MOOD_BORED
return new_mood
def hungryAction (action):
new_mood = MOOD_HUNGRY
if action == ACTION_PLAY:
new_mood = MOOD_ANGRY
elif action == ACTION_IGNOR:
new_mood = MOOD_DEAD
elif action == ACTION_PET:
new_mood = MOOD_HUNGRY
elif action == ACTION_FEED:
new_mood = MOOD_SLEEPING
return new_mood
def setMood (action, mood):
new_mood = mood
if mood == MOOD_HAPPY:
new_mood = happyAction (action)
elif mood == MOOD_HUNGRY:
new_mood = hungryAction (action)
elif mood == MOOD_BORED:
new_mood = boredAction (action)
elif mood == MOOD_ANGRY:
new_mood = angryAction (action)
elif mood == MOOD_SLEEPING:
new_mood = sleepingAction (action)
return new_mood
def getAction (rec1, rec2, rec3, rec4, mouseClick):
if inBox(rec1, mouseClick):
return ACTION_PET
elif inBox(rec2, mouseClick):
return ACTION_FEED
elif inBox(rec3, mouseClick):
return ACTION_PLAY
elif inBox(rec4, mouseClick):
return ACTION_IGNOR
else:
return ACTION_ERROR
def drawDogMood (win, mood):
if mood == 1:
drawHappy(win)
elif mood == 2:
drawAngry(win)
elif mood == 3:
drawSleeping(win)
elif mood == 4:
drawBored(win)
elif mood == 5:
drawHungry(win)
elif mood == 6:
drawDead(win)
def clear_screen(win):
# overwrite the screen with a blank rectangle (clears the screen)
rec=Rectangle(Point(10,10),Point(600,440))
rec.setFill("white")
rec.draw(win)
# create the buttons at the bottom of the screen
def draw_buttons(win):
# draw line at bottom of screen
line1 = Line(Point(10,440),Point(600,440))# create line
line1.draw(win) # draw it
# draw the 6 buttons at the bottom of the screen
rec1 = drawRec(win, Point(5,450), Point(150,490), 'green', 'Pet')
rec2 = drawRec(win, Point(160,450), Point(300,490), 'green', 'Feed')
rec3 = drawRec(win, Point(310,450), Point(460,490), 'green', 'Play')
rec4 = drawRec(win, Point(470,450), Point(610,490), 'green', 'Ignor')
return rec1, rec2, rec3, rec4
# function to draw a button
# parameters: win - Window to draw in (GraphWin object)
# recTop - Top corner of button (Point object)
# recBot - Bottom corner of button (Point object)
# color - Color of button (string or Color object)
# mood - Text of button (string)
#
# return: a list of these paramters so we can save them of later use
def drawRec(win, recTop, recBot, color, mood):
"""(top corner, bottom corner, color, mood)"""
rec = Rectangle(recTop,recBot)# create rectangle
rec.setFill(color) # set fill color
rec.draw(win) # draw it
label = Text(Point((recTop.getX()+recBot.getX())/2,(recBot.getY()+recTop.getY())/2),mood)
label.draw(win) # draw label
return [recTop,recBot,color]
# function to determine of mouse click is in button box
# parameters: rec - The rectangle of the button box
# click - The Point coordinates of the mouse click
#
# return: True - If click is in the rectangle
# False - If click is NOT in the rectangle
def inBox(rec, click):
"""(rec, click) checks if click in rec"""
recTop = rec[0]
recBot = rec[1]
if (click.getX() > recTop.getX()) and (click.getX()< recBot.getX()):
if (click.getY() > recTop.getY()) and (click.getY() < recBot.getY()):
return True
return False
#
# Place your shared functions here so they can be used by the
# draw mood functions.
#
def drawbody(win):
lear = Oval (Point(175,125), Point(250,400))
lear.setFill('tan')
lear.setOutline('tan')
rear = Oval (Point (425,125), Point (350,400))
rear.setFill('tan')
rear.setOutline('tan')
head = Circle (Point (300,200), 100)
head.setFill('brown')
head.setOutline('brown')
nose = Polygon (Point (275,225), Point (325,225), Point (300,250))
nose.setFill('black')
lear.draw(win)
rear.draw(win)
head.draw(win)
nose.draw(win)
# draw happy dog (Place your code here)
def drawHappy(win):
"""draws happy dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('white')
leye.setOutline('white')
leyecolor = Circle (Point (250,175), 15)
leyecolor.setFill('blue')
leyecolor.setOutline('blue')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('white')
reye.setOutline('white')
reyecolor = Circle (Point (350,175), 15)
reyecolor.setFill('Blue')
reyecolor.setOutline('blue')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
happymouth = Polygon (Point (275,265), Point (325,265), Point (325,275), Point (315,290), Point (285,290), Point (275,275))
happymouth.setFill('black')
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
happymouth.draw(win)
# draw angry dog (Place your code here)
def drawAngry(win):
"""draws angry dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('white')
leye.setOutline('white')
leyecolor = Circle (Point (250,175), 15)
leyecolor.setFill('red')
leyecolor.setOutline('red')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('white')
reye.setOutline('white')
reyecolor = Circle (Point (350,175), 15)
reyecolor.setFill('red')
reyecolor.setOutline('red')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
mad = Polygon (Point (250,130), Point (350,130), Point (325,175), Point (275,175))
mad.setFill('brown')
mad.setOutline('brown')
teeth = Polygon (Point (250,265), Point (350,265), Point (338,245), Point (326,265), Point (314,245), Point (302,265), Point (290,245), Point (278,265), Point (266,245), Point (254,265))
teeth.setFill('white')
teeth.setOutline('white')
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
mad.draw(win)
teeth.draw(win)
# draw sleeping dog (Place your code here)
def drawSleeping(win):
"""draws sleeping dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('brown')
reye = Circle (Point (350,175), 25)
reye.setFill('brown')
sleepingmouth = Circle (Point (300,275), 10)
sleepingmouth.setFill('black')
leye.draw(win)
reye.draw(win)
sleepingmouth.draw(win)
# draw bored dog (Place your code here)
def drawBored(win):
"""draws bored dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('white')
leye.setOutline('white')
leyecolor = Circle (Point (250,175), 15)
leyecolor.setFill('blue')
leyecolor.setOutline('blue')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('white')
reye.setOutline('white')
reyecolor = Circle (Point (350,175), 15)
reyecolor.setFill('Blue')
reyecolor.setOutline('blue')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
bored = Rectangle(Point (220,145), Point (375,165))
bored.setFill('brown')
bored.setOutline('brown')
bm = Polygon (Point (275,275), Point (325,275))
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
bored.draw(win)
bm.draw(win)
# draw hungry dog (Place your code here)
def drawHungry(win):
"""draws hungry dog"""
clear_screen(win)
drawbody(win)
leye = Circle (Point (250,175), 25)
leye.setFill('white')
leye.setOutline('white')
leyecolor = Circle (Point (250,175), 20)
leyecolor.setFill('blue')
leyecolor.setOutline('blue')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('white')
reye.setOutline('white')
reyecolor = Circle (Point (350,175), 20)
reyecolor.setFill('Blue')
reyecolor.setOutline('blue')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
sad = Rectangle(Point (220,187), Point (390,205))
sad.setFill('brown')
sad.setOutline('brown')
feed = Oval (Point (275,265), Point (325,285))
feed.setFill('black')
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
sad.draw(win)
feed.draw(win)
# draw dead dog (Place your code here)
def drawDead(win):
"""draws dead dog"""
clear_screen(win)
lear = Oval (Point(175,125), Point(250,400))
lear.setFill('tan4')
lear.setOutline('tan4')
rear = Oval (Point (425,125), Point (350,400))
rear.setFill('tan4')
rear.setOutline('tan4')
head = Circle (Point (300,200), 100)
head.setFill('brown4')
head.setOutline('brown4')
nose = Polygon (Point (275,225), Point (325,225), Point (300,250))
nose.setFill('black')
leye = Circle (Point (250,175), 25)
leye.setFill('yellow')
leye.setOutline('yellow')
leyecolor = Circle (Point (250,175), 15)
leyecolor.setFill('green')
leyecolor.setOutline('green')
leyris = Circle (Point (250,175), 10)
leyris.setFill('black')
leyris.setOutline('black')
reye = Circle (Point (350,175), 25)
reye.setFill('yellow')
reye.setOutline('yellow')
reyecolor = Circle (Point (350,175), 15)
reyecolor.setFill('green')
reyecolor.setOutline('green')
reyris = Circle (Point (350,175), 10)
reyris.setFill('black')
reyris.setOutline('black')
teeth = Polygon (Point (250,265), Point (350,265), Point (338,245), Point (326,265), Point (314,245), Point (302,265), Point (290,245), Point (278,265), Point (266,245), Point (254,265))
teeth.setFill('white')
teeth.setOutline('white')
lear.draw(win)
rear.draw(win)
head.draw(win)
nose.draw(win)
leye.draw(win)
reye.draw(win)
leyecolor.draw(win)
leyris.draw(win)
reyecolor.draw(win)
reyris.draw(win)
teeth.draw(win)
# run main loop
main()