CS 422 - MP 1: Mine Sweepr

Due: Thursday 1/29/2004 at 11:59 pm

For this program, you are to create the game Mine Sweeper similar to the "beginner game" that can be found on on most Windows computers. You are to create either a 8x8, 9x9 or 10x10 grid for your version (no point difference based on the grid used).

Your program should randomly place 10 bombs on the grid at the beginning of each game. The game is played by the user clearing positions on the grid by clicking with the left mouse button. Clicking with the right mouse button allows the user to mark each uncleared grid position with a flag, a question mark or no mark. Note: the left click will only clear a grid position if that grid position has no mark or a question mark.

If the user left clicks on a grid position with a bomb, the user loses and the game is over. If the user clears all of the positions without bombs, the user wins the games.

Your program should include a clock that keeps track of the time starting with the first click of a grid position until the game is over. The faster winning score should be saved in some text file that will be in the same directory as the program. If the text file does not exist, assume there has been no "fastest winner".

Your program should also include a counter to keep track of the number of unflagged bombs. Your program should also have a "new game" button. You can earn extra credit by have this "new game" button change as the game progresses. The Windows game has 4 icons associated with this button:

  1. A regular smiley face (shown by default)
  2. A "scared" face (shown with each button press)
  3. A smiley face with sunglasses (shown when the game is won)
  4. A "frowning" face (shown when the game is lost)

When placing the bombs, use some random function however make sure that each bomb is placed in a separate grid position. You must place the bombs after the user clicks on the first grid position with no bombs being placed in this first clicked position. This makes sure the user at least has some chance to win.

Your program should have a menu bar with two items: Game and Help. The Help menu should two items: one to provide directions on game play and one to given information about the programmer. The Game menu should have items to start a new name, show the fastest time, and exit.

Your program is to submitted electronically via the turnin command on the CS Department Computers using the project name of mp1.