URGENT Need help creating Code for Memory Matching game

I have to create a memory matching game for my computer science class using a two dim array, but there are concepts on this project we have not yet learned in class. Can anyone help me write a code for this project, I don't even know where to begin?

Here are the instructions:

Select a Theme and have 50 words associated with it
Words must have a common theme - your choice

Examples: Like Periodic Table Elements, or Sports teams, or Types of cars…
Have one Term describing category you picked. This is the FACE term…

Menu:
Start Button
New Game Button
Exit Game Button

Level of Play – Use selects at start of game
4 x 4 grid (Easy)
6 x 6 grid (Moderate)
8 X 8 grid (Difficult)

Speed of Play – At start of game, User selects time interval for clicked-on term-pair to display
1 seconds (Difficult)
3 seconds (Moderate)
5 seconds (Easy)

Populate Grid with Term
At start of game – program places the same face/theme term in all squares in the visible grid

If 4 x 4 grid, randomly pick 8 terms, place each image name twice in 2-Dim array.
If 6 x 6 grid, randomly pick 18 terns, place each image name twice in 2-Dim array.
If 8 x 8 grid, randomly pick 32 terms, place each image name twice in 2-Dim array.
The 2-Dim Array corresponds to grid on screen.

During the course of play, the face/theme term in the grid is replaced by a
corresponding array terms, when user selects a grid square

Game Play

1) User selects a FIRST square, the theme/face term in the grid square is replace with correspond stored term, from the 2-dim array

2) User selects a SECOND square, the term theme/face in the second grid square is replace with the corresponding stored term, from the 2-dim array

3) The computer compares the terms for the two selected squares.
If they are the same, the terms remain on the screen and can no longer be selected.

If they are different, the term remain the screen for 1, 3 or 5 seconds, depending on user selection at the beginning of the game. After that elapse time, those two grid terms are replaced with the face/theme term.

To start with, here is an example of a similar game: http://www.mathsisfun.com/games/memory/

I had to do something similar for a mobile apps class, but that was Java and GUI oriented. Regardless, the basics are fairly simple. The theme, or "face term" is irrelevant other than setting the stage. It could just as easily be the blank squares, like in the example, or the back of a card, or even a print out of "car", to use one of your examples. If you use cars, for example, you need to think up 25 different car names; that is probably the hardest part.

Do not worry about making the different levels until you have the first (4x4) one working, once you get that, the rest will fall into place.

If that isn't enough to get you started;
string car[25] = {"car1", "car2", ...,"car25"};
Then you just need to randomize the array and put 2 each of the first 8 into the 2D array.

After that, it's mostly just a matter of setting up a timer to rest the screen and scaling it up for bigger grids.
Topic archived. No new replies allowed.