A full game - Concentration


Written By TheVBProgramer.




Write a VB application that implements a game of Concentration. In a game of Concentration, the player is presented with a board containing some number (24 in my implementation) of "covered" images. The player clicks on the covered pictures in sets of two to reveal the randomly assigned pictures beneath. If the two pictures match, they remain displayed; if not, they are flipped back over. The goal of the game is to reveal all matches (12 in my implementation) in as short a time as possible.


The program must maintain (in a file) the best time and display it on the screen as the "time to beat". Whenever the best score is beat, the new time becomes the best score and should be written out to the file.


My implementation also tracks the number of turns it took to reveal all matches (the fewer the better). A perfect score would be 12 in my implementation (but a score of 12 turns would be nearly impossible, as the player would have make 12 correct guesses in a row).


My implementation of the game is shown below. I am using playing cards as the pictures.


When the game first starts, all cards are shown face down. The "Best Scores" area shows the previous best time and number of turns, read in from a file. (Note: The "Reset" button effectively clears the best scores – it sets the best time to 99:99 and the number of turns to 9999.) The clock for "This Game" has started ticking.




In the middle of game play, the pairs that have been matched remain face up, those yet to be matched remain face down. The clock is still ticking (one minute, 20 seconds – looks like we're not going beat the best time of one minute, 14 seconds!).



At the end of the game, all cards will be face up and the clock will stop ticking.



Download the solution for this project here.


If you enjoyed this post, subscribe for updates (it's free)

source code

please send me the source code for this game so it would help me to understand the game

Help Please

can you copy and paste all of the code for this memory game please?


Hi Peeps..
This Game is Smashing and includes A Full Deck of Nice Playing Cards to use in your own Apps.
and it has Lots of Clear Code.. Nice Job Coder.


Selecting the Same Playing Card Twice Locks The Card in the Face up Position I.E.
Click A Unturned Card and then Click The Face of the Newly turned card And You will See What I Mean.

It seems that in the Card Click Event "Private Sub imgGameCard_Click(Index As Integer)" There is
nothing to Determine Whether or not the (Index) Value of the Second Card Has the same (Index) Value
of the First.

Therefore when you click the First card And then the First card Again The (mintClickCount) increments to
2 on the second Click, even though the card is the same card AND of course It matches the value of the first Card..
Simple Fix.. AND if you click the same card twice it acts as a cancel and Re-turns the Card to Face Down

In the code of Concern.frm Locate The " Private Sub imgGameCard_Click(Index As Integer) " Sub
and then Copy and Paste The Code Below to the Position Outlined. :)

' imgGameCard(Index) = frmCards.imgCard(mintGameCards(Index))
' mintSecondCard = Index

If mintFirstCard = mintSecondCard Then
imgGameCard(mintFirstCard) = frmCards.imgCard(0)
imgGameCard(mintSecondCard) = frmCards.imgCard(0)
mintClickCount = 0
Exit Sub
End If

' imgGameCard(Index) = frmCards.imgCard(mintGameCards(Index))

And how the Hell do i HTML tag my Font Back to normal.?...Ooh IC.. Blank Line.. :P

need source code in VB 10

I am working on a similar project in Visual Basic 2010 and need the code as I am new to programming and not sure where to begin writing any help would be appreciated.


I must say, this is really a interesting blog. Thumbs up to the author.

how can you open up word and

how can you open up word and other programms by coding them in button?

request for coding of game

hi i want to make my this game plz send me compelete coding


Can u help how to create this game??..or u can send me the code tnx..this is my email thunder_emperor85@yahoo.com

People asking for code

Why are others asking for the code when it is an attachment in the download file!
See what other people can make out of it!

dear sir i am

dear sir
i am new programmer so i want to learn the code that you use in this game ,that may possible?
i am new in this field so send me some idea how to learn about such code , i am intested to learn about code



Game Code

Thank you for sharing this game of concentration with all of us. :)
May the code be sent to my email? It would be wonderful if it was sent.
My email is: SiriusA@live.ca


will you please forward me the codes if you got them please. I really need help with my project and am doing a similar one. thank u.

Can anyone please send me the

Can anyone please send me the concentration game codes if they have it. I really need help with my project. Thank you.... skyli13@live.com


hi sir/madame may i ask you for the code of your concentration game because i have a project that i have to do and i would like to understand the code that you have used for the program. Don't worry i won't copy any of your codes just to understand the codes. If you do accept could you please email me tha codes at unknownpeople@hotmail.ca

Concentration game code

Hi, would you please send me the code for the game, so I can see how it is done.




I need your help sir.....I'm creating same game same as you name memory game....I don't know how to code for the high score and remember the player name and their score........hope you can help me sir.....and Sir can i get the code for this game..Can u contact me using my email...
Thanks Sir


hi.. im a newbie at visual basic and i have a software engineering project. we must us VB 6 on this certain project.. i'm creating a dictionary. when a certain word is entered, it will display an image if available. pls help me.. thnx so much.. my e-mail is spiker_akp73@yahoo.com

Pls Sir, i am a new

Pls Sir,
i am a new programmer and i am very interested in becoming a very good programmer.
pls can you help me with some tutorials that will help me in achieving my dreams, i will very grateful.
this is my e-mail address
Pls sir, you can send the tutorials to my email.
i will be very grateful.
thanks for your anticipated good response.


we are programmer.,.,
so we need to study,.
and use our imagination,.
and i believe that we can do the program we want,.,.
just think,.,
to study and not to think is WASTE
to think and not to study is DANGEROUS

your right

just analyze the interface and you'll see how does it works
use your imagination to formulate the code behind that program..

can you help me?

we have a thesis. we need to make a System using VB6.0 It is a Time in Time out System. every professor should Enter their personal code to see their schedules. got it? please help me.. Please reply. thanks

source code and interface

Respected sir
I want source code with interface for small vb games.can u please send it as soon as possible...........

pls...send me a solution

pls...send me a solution about creating this game....coz i can't gat it! it's very hard for me.....thanks.....


can you gave me the source code of this program to my email thank you...


hai,,everyone,,who knows the code of this game in VB6..PlS send me a coDe...heres my email address:::::: francisco_joshua15@yahoo.com...we need a program that will use VB6 to create a simple or any otHer games..This program is really helpfuL..great thanKs tO whOm be respoNDinG...thanks.... :-D



please give me the code for these game please

i am very interesting to know about how these games are formed in vb
so please tell me the codes fer these games on my id


WHAT THE HECK are you noobs asking for the source code for?


pls can u send the sourcecode to my email ford_dy@yahoo.com


very thanks

Q&A game (vb6.0 code)

hu cn help me with this??,.. please thanks

can u plz send me the code

can u plz send me the code of this prg at my email id...

My comment

tyryhai sir i am muniaraj ,i have a one problem multi report i am created but report is one generated display ,that time next report generated but no display
what do to


can you gave me this source code thanks...

could i please get the code to this game?

could i please get the code to this game? i'm working on a school project and need some help...
my email address is tp-hutchings@hotmail.com
thathanks :]


heyhey there, please kindly send me the code at runechrist_@hotmail.com. You wil be blessed



it' s good

i like it

WTF wers the Code......?

WTF wers the Code......?

I found a bug! i got the

I found a bug!
i got the joker upp but he stays upp :S
youst one :S

send the code

help me to learn this prog....
kindly give the code......or send it to my email add:danielogendi@yahoo.com
plssss help


hu can help me doin' this PACMAN VB CODE...
here's my email:

here is ur PACMAN VB CODE



i think u will like it, peace


hello i want to learn how to creat database for my visual basic program: pls tell me how thanks a lot in advance>>>>

help me to learn this prog....

kindly give the code......or send it to my email add:alanruiz_18@yahoo.com
plssss help me i want to be learned visual basic...


small but interesting game u put ere.can u put another 1 with explanation 4 every code in the program in order to understand everybody? thanx.


Like for example, how do you choose 12 random cards thats gonna be under those blank ones, and theres always two of the same card?
Please help, want to know this kinda thing, would've helped me alot...


I was hoping to get you to try to teach how to make it, because it sounds sweet, and i want to know how to make it :P
I dont like do download projects, makes me feel lazy :(

Unfortunately I have a huge

Unfortunately I have a huge list of tutorials to write at the moment. Maybe you could download this code and write a tutorial for it. I will gladly post it here with your info for the credit. This way you learn, you don't feel lazy, and you help others at this site.

i am new in vb plz send me

i am new in vb plz send me tutorials

i am ne in vb plz send me

i am ne in vb plz send me tutorial


Im considering to make a tutorial on an easier project, but i think ill have to improve my english first ;-p
Love this site, helped me alot.


ok thanx a lot