How to create a Memory Game

hi fellow member.. i just wondering how to create a memory game by using C++ language.. its really helpul to guide me or show me how to program this game.. TQ!
what kind of memory game??
games like confuse or blocks what i call them. where there are many cards on the board and one has to find and match pair of cards.
the one that has to find and match pair of card.. :)
ok.. i think we are talking about the same game..
see the basic idea will be to spread the pairs on a n X n board..

lets say we have a 4X4 board so we can have 8 type of cards on that board.
run a loop 8 times, in each iteration place two cards of that type randomly on some position.
now those positions are occupied, so in the next iteration when you generate the random numbers the occupied ones you can generate. thats it i think..

lets say.. char cards[8] = {'A', 'B', ... ,'H'}; //these are your cards
in first iteration you have to place 'A' on any two position.. and so on.

now when the user will play and open a card, you have to just show the value of that card from your matrix.

does this make sense??
Topic archived. No new replies allowed.