Project 3

Memory Game

Due: Thursday, April 5, 2012 at 11:59 pm

In this program, you are to use the Qt Library to create a version of the "Memory Game" as can be found at the following links: You are to create a grid of at least 20 squares that will hide half that number of images. Each image is hidden behind two of the squares. The user is to select two of the images by clicking them with the mouse. As each image is selected, it shall be displayed. If the two images do not match, they are hidden from the user after a short period of time. If the two images match, the images either remain unhidden. Once the images have been matched, the user cannot select those images again. The user continues to play until all of the images have been unhidden.

The middle two examples from tyhe above list have the unmatched pictures remain showing until the next square is selected. You are not to do this in your project. You are to use the QTimer class to automatically hide the unmatched images after a short period of time.

Your project must also have include a menu that allows the user to select a directory that would contain the images to be matched. One place to find some images is at which has some open source playing and tarot card images. If the directory has more images than what is needed by the game, just select the number of images needed by randomly selecting the proper number of images needed. If the directory has less than the number of images needed, display an error message and allow the user to select a different directory. The game should start up with a default set of images, you may assume that these images are in some "proper" location when the game starts (in the same directory, in a specific sub-directory, etc.).

Your project is also to have the following additional menu items:

  • Exit - quit the program
  • About - display a dialog box that provides information about the author of the program
  • Help - display a dialog box that explains how to play the game
  • Statistics - display a dialog box that shows some basic statistics about the games that have been played. This information should include the number of games played, the fewest number of guesses needed to unhide all of the images.
For 10 points extra credit, when two images are matched, they are to be replaced by two parts of some final larger image. As the player matches more and more of the initial images, more of the final image becomes displayed. How this final image is coded or broken down is left entirely up to you. One way is to take an image and break it into multiple parts and replace the initial images with the correct piece of the final image when a match occurs.

Your program must be written in good programming style. This includes (but is not limited to) meaningful identifier names, a file header at the beginning of each source code file, a function header at the beginning of the function, proper use of blank lines and indentation to aide in the reading of your code, explanatory "value-added" in-line comments, etc.

You may work on this project with a partner. Your header information and About box must clearly state who is working on the project. The work you turn in must be 100% from your own group. You are not allowed to share code with any other person (inside this class or not) who are not in your group. You may discuss the project with other persons; however, you may not show any code you write to another person nor may you look at any other person's written code.

You are to submityour code via the proper assignment link in Blackboard. Groups are only to submit the project one time. Your header information and About box must clearly state who is working on the project.

Topic revision: r2 - 2012-03-20 - 14:58:24 - Main.troy
Copyright 2016 The Board of Trustees
of the University of
Helping Women Faculty Advance
Funded by NSF