Answered step by step
Verified Expert Solution
Question
1 Approved Answer
app.background = 'lightCyan' app.cheesesEaten = 0 # wall Rect ( - 2 , 2 9 0 , 4 0 4 , 3 0 , fill
app.background 'lightCyan' app.cheesesEaten # wall Rect fillrgb border'black' Rect fill'skyBlue', border'saddleBrown', borderWidth Rect fill'seaGreen' Line fill'saddleBrown', lineWidth Line fill'saddleBrown', lineWidth # floor Rect fillgradientwheat 'burlyWood', start'bottom' Line lineWidth dashes # table table Polygon fill'tan', border'black' # mouse hole Circle Rect # mouse eyes eyes Group Circle fill'white' Circle fill'white' # cheese crumbs Circle fill'lemonChiffon' Circle fill'lemonChiffon' Circle fill'lemonChiffon' Circle fill'darkOrange' Circle fill'darkOrange' Circle fill'darkOrange' Circle fill'darkOrange' Circle fill'khaki' Circle fill'khaki' # cheeses cheeseWheel Group Oval fill'lemonChiffon', border'black' Rect border'black', dashes fill'lemonChiffon' Oval fill'lemonChiffon', border'black' cheeseBlock Group Rect fill'darkOrange', border'black' Polygon fill'darkOrange', border'black' Polygon fill'darkOrange', border'black' cheeseWedge Group Rect fill'khaki', border'black' Polygon fill'khaki', border'black', borderWidth mouse Group Line fill'pink', lineWidth Oval fill'gainsboro', border'black', borderWidth Circle fill'darkGrey', border'black', borderWidth Circle fill'darkGrey', border'black', borderWidth Polygon fill'gainsboro', border'black', borderWidth Rect fill'gainsboro' Circle fill'hotPink' Circle Circle mouse.visible False mouse.width def onMousePressmouseX mouseY: # When the table is clicked on move the animal mouse from its hole onto # the table. ### HINT: The mouse's centerY should be ### Place your code here ### pass def eatCheesecheese: mouse.width app.cheesesEaten cheese.clear def onMouseReleasemouseX mouseY: # If the computer mouse is released on any of the cheese groups, eat the # cheese. ### HINT: Call the eatCheese function with the proper cheese group! ### Place your code here ### # If there is still uneaten cheese, hides the mouse and makes the eyes # reappear in the mousehole. if appcheesesEaten : eyes.visible True mouse.visible False
app.background 'lightCyan'
app.cheesesEaten
# wall
Rect fillrgb border'black'
Rect fill'skyBlue', border'saddleBrown', borderWidth
Rect fill'seaGreen'
Line fill'saddleBrown', lineWidth
Line fill'saddleBrown', lineWidth
# floor
Rect fillgradientwheat 'burlyWood', start'bottom'
Line lineWidth dashes
# table
table Polygon fill'tan',
border'black'
# mouse hole
Circle
Rect
# mouse eyes
eyes Group
Circle fill'white'
Circle fill'white'
# cheese crumbs
Circle fill'lemonChiffon'
Circle fill'lemonChiffon'
Circle fill'lemonChiffon'
Circle fill'darkOrange'
Circle fill'darkOrange'
Circle fill'darkOrange'
Circle fill'darkOrange'
Circle fill'khaki'
Circle fill'khaki'
# cheeses
cheeseWheel Group
Oval fill'lemonChiffon', border'black'
Rect border'black', dashes fill'lemonChiffon'
Oval fill'lemonChiffon', border'black'
cheeseBlock Group
Rect fill'darkOrange', border'black'
Polygon fill'darkOrange',
border'black'
Polygon fill'darkOrange',
border'black'
cheeseWedge Group
Rect fill'khaki', border'black'
Polygon fill'khaki', border'black',
borderWidth
mouse Group
Line fill'pink', lineWidth
Oval fill'gainsboro', border'black', borderWidth
Circle fill'darkGrey', border'black', borderWidth
Circle fill'darkGrey', border'black', borderWidth
Polygon fill'gainsboro',
border'black', borderWidth
Rect fill'gainsboro'
Circle fill'hotPink'
Circle
Circle
mouse.visible False
mouse.width
def onMousePressmouseX mouseY:
# When the table is clicked on move the animal mouse from its hole onto
# the table.
### HINT: The mouse's centerY should be
### Place your code here ###
pass
def eatCheesecheese:
mouse.width
app.cheesesEaten
cheese.clear
def onMouseReleasemouseX mouseY:
# If the computer mouse is released on any of the cheese groups, eat the
# cheese.
### HINT: Call the eatCheese function with the proper cheese group!
### Place your code here ###
# If there is still uneaten cheese, hides the mouse and makes the eyes
# reappear in the mousehole.
if appcheesesEaten :
eyes.visible True
mouse.visible False
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started