This week, we are going to start creating a memory matching game. Imagine a game where you have ten squares, and you need to pick two squares and see if they match. If they match, the player receives a point, and those images appear, if they don’t match, the program should hide the pictures again.
After choosing the second image, it should count as a single attempt. Summarize all the attempts and send those to a final summary page after matching all the images. To do this, you are going to use arrays, loops, if statements, cookies or the query string, and the Math functions (particularly random). Also, it’s possible you might need to use some debugging tools too. Whew! Seems like a lot especially in one week. So, we are going to break it up.
This week, we are going to focus on creating an array of images and an array of blanks. You are going to print out all the blank images from your blank array. You are also going to create an array of randomized images in your actual image array. This one will be a little trickier because you will have to determine if an image is already in the array twice. Make the size of both arrays set to ten.
Once you have those two arrays built, you are to create and display the first blank array. Then, if the user clicks on a blank image, the corresponding image from the actual image array should appear.
You do not need to go further for this week.
Specifics: