For your class project, you are to write an interactive Web page that allows the user to play the game Memory (often referred to as Concentration). In the game, 15 pairs of matching cards are displayed in a 6x5 grid face down and players take turns flipping two cards. If the cards match, then the pair is credited to that player and they get another turn. If the cards don't match, then the cards are returned face down and the other player gets a turn. The player with the most pairs at the end of the game (when all pairs have been found) is the winner.
Your page must provide a reasonable interface for the game. There should be a grid of images that represent the backs of the cards. When a player clicks on a card, its face should be revealed (i.e., replace the back image). If the second card selected by a player matches the first card, then the cards should be removed and the score for that player updated on the page. If the cards do not match, they should be replaced with the back image after a reasonable delay (say 1 second) and the other player should be notified of their turn. In addition, your page should allow for a 1-player mode, where a single player makes all of the selections while trying to minimize the number of card flips. In 1-player mode, the number of flips should be maintained and displayed on the page.
The user must be able to choose between a 2-player or 1-player game within the page, and should be able to play multiple games in succession (without reloading the page). To make the page user-friendly, it should provide help facilities that describe the rules and give instructions on how to interact with the page. Part of the grade for the project will be based on the elegance of the page design and its overall usability.
You may work with a partner in developing this project. In fact, working as a team is encouraged, since discussions about design and debugging often lead to a more robust, user-friendly application. If you do work in a team, only one program need be submitted for the team. To allow plenty of time for collaboration and feedback from the instructor, this assignment will be spread over the rest of this semester.
Reminder: You are expressly forbidden to look at anyone else's source code for a comparable game.