memory-game
memory-game copied to clipboard
Updated app.js
1.Added Player Turn and Match Tracking: Introduced variables playerTurn to keep track of which player's turn it is and matches to record the number of matches each player has made.
2.Updated Match Logic: Adjusted the logic in the checkForMatch function to handle the new multiplayer functionality. When a match is found, it updates the respective player's match count and displays it on the screen.
3.Updated Display: Changed the result display to show the match count for both players.
4.Determined Winner: Added logic to determine the winner based on the number of matches each player has made when the game is over.
5.Alternate Turns: Implemented logic to alternate between player turns after each match attempt.