Tech Memory is built using the following technologies:
- HTML
- jQuery
- Font-Awesome for the icons
- Create an array to store all the icons. There are 12 pairs.
- Randomly shuffle the icons in the array.
- For each icon in the array, create each tile as a div within the "memory_board" div.
- Allow each user to click only up to 2 tiles at a time.
- If the 2 tiles match, add the player's colour to them, update the score and keep track of the number of tiles uncovered. Let the same player continue playing.
- If the 2 tiles do not match, switch players. Cover back the tiles after 700 ms.
- When all the tiles have been clicked, present the score in a dialog box and reset the game.
- When the page loads, Player 1 always starts first as indicated by his label being shown in red. Player 1 can click any 2 tiles to display the respective icons.
- If this results in a match, Player 1 continues playing.
- If not, it is now Player 2's turn. Similarly, Player 2 keeps his/her turn as long as he/she continues uncovering matches.
- The relevant scores are updated during gameplay.
- If you want to reset the game at anytime, click on the reset button.
- The game ends when all tiles have been uncovered.