Memory Game


20 points



You've probably played Memory or Concentration with playing cards. You spread the cards on a table, face down, in rows and columns. Each player, for their turn, chooses 2 cards to turn over. If the 2 cards match, the player earns a point and the 2 cards are removed from the table. Play continues until all the cards have been removed from the table. The player with the greatest number of points wins the game.

This Memory game is similar. There are 16 windows on the screen and, when clicked, each window displays an image. If a player displays 2 images that match, they get 1 point and the 2 images stay face up. If the 2 images don't match, the 2 images are hidden again and play continues until all the image pairs have been uncovered.



At the start of a game
In the middle of a game


Starting Point

For this project, I've provided some code and instructions that could help you to complete the project. Feel free to not use this code and these instructions if you'd rather figure things out in your own way, from scratch.



I used 8 fractal images, 1 window image and 1 green button image. Feel free to find your own images. If, however, you'd like to use the images that I used, you can download them here.



The video, linked to below, shows what a completed app should do.


Extra Credit (3 points)

Write some additional code so that each game is different. That is, the underlying images are scrambled differently for each game. To do this, write the randomizeImages() function.