Homework 7
Home   Lectures   Solutions   Syllabus      Instructor's Site  
Homework 7 - Due Wednesday 11 April at 11:59pm.

Most if not all of you have seen and perhaps played the once popular arcade game "Whack a Mole." An Alice version of this game is depicted below. Using this Whack a Mole world, write your own Whack a Mole game. You are allowed some discretion in the working of this game with the following conditions:

  1. The game must employ an instance of the timer class we created together.
  2. It must use the timer to limit the amount of time a user has to complete a game.
  3. Moles must continue to pop up and down until the timer expires.
  4. The user must whack a specified number of moles within the time limit you specify.
  5. The number of moles whacked so far should be displayed in addition to the time remaining
  6. Moles selected to pop up and down should be selected at random (a random integer should be used within a loop).
  7. When the timer expires, all activity should stop and a message should be displayed telling the user whether he/she won or lost.