Memory Match
Find every matching pair in a grid of face-down cards.
Overview
Memory Match (also called Concentration or Pairs) is a card-flipping memory game. A grid of face-down cards conceals pairs of matching symbols; flip two at a time, and if they match, they stay revealed. The round ends when every pair is found. The fewer flips and the less time it takes, the better.
This implementation supports several grid sizes — typically 4x4 for kids, 6x6 for adults, and larger for serious memory training — and shuffles a fresh symbol set each round. It's a quick, pleasant cognitive workout and a useful proxy for visuospatial working-memory span.
How it works
The deck is built by taking N distinct symbols and duplicating each one, then shuffling the resulting 2N cards using a Fisher-Yates shuffle and laying them face-down on the grid. Clicking a face-down card flips it face-up; once two are face-up, the engine pauses briefly to let you see them, then either marks them matched (if equal) or flips them face-down again (if not).
Optimal play requires zero re-checks: once you've seen two cards in different positions, remembering both lets you secure that pair the next time you see one of them. In practice, players run out of working-memory slots around five to seven distinct symbols on the board, after which they need a second look. The flip count therefore scales steeply with grid size.
Examples
- A 4x4 board has 8 pairs. Perfect play takes 16 flips; average human play takes 22-30.
- A 6x6 board has 18 pairs and stresses working memory hard — perfect play is 36 flips, typical is 60-80.
- The "first pair" guess on a fresh board has only a 1 in 15 chance of matching on a 4x4.
- Recording every reveal mentally beats randomly checking; even basic "I saw a star in the top-right" notes shave flips.
FAQ
Why do my matches sometimes flip back when I clicked correctly?
If the second card doesn't match the first, both flip back. Re-check that the two symbols were really identical.
Are the symbols always the same set?
No — a fresh symbol set is drawn each round so you can't memorise positions across games.
Is there a time bonus?
The board tracks elapsed time and flips. Combining both into a "score" depends on house rules.
Does the engine cheat by changing card positions?
No. Cards are placed once at game start and stay fixed.
Can I undo a flip?
No — the flip count is your honest score. Resigning and restarting is the only reset.