cmcrawford2 / memory-game

Memory card game from 1968.
https://boisterous-palmier-c30f9d.netlify.app/
MIT License
1 stars 4 forks source link

Play against the computer #3

Open cmcrawford2 opened 12 months ago

cmcrawford2 commented 12 months ago

The computer needs to be added as a second player. This is not a beginner issue. It requires changes to the look of the project and changes to the way the game is scored.

rolandolopez commented 11 months ago

I have been thinking about this and here's what I propose: Make it a two player game first. A 1 v 1 game. That way you have the the turn-taking aspect down first. Then you can add the computer player.

cmcrawford2 commented 11 months ago

OK that sounds good. I've made two-player games before. You need to save state for which player, also a rule that says player only changes after the other player picks a pair that doesn't match.

cmcrawford2 commented 11 months ago

And you need a message that says "player 1, you're up!" or "player 2, you're up!"

cmcrawford2 commented 11 months ago

A computer would be more difficult because the computer memory has to be stored somehow. And you need to be able to make the computer memory not be perfect, to tune it somehow to only remember the last few moves, then have it forget.

rolandolopez commented 11 months ago

I think maybe there should be levels for the computer. Easy: the computer will randomly picks cards, Medium: computer will remember the last few cards, Hard: computer remembers EVERYTHING :)