Memory Match
Every card above is face down, and every shape on the board appears exactly twice. Turn one card, then another. A pair stays up. Anything else goes back over after a moment, and that moment is the entire game: it is long enough to memorise and short enough to punish you for not bothering. What you are doing is not guessing. It is remembering where the last mistake was.
Every page in this section
- ConcentrationConcentration, playable in the page
- PairsPairs, playable in the page
- Memory Game for KidsMemory Game for Kids, playable in the page
The second you are not allowed to skip
When two cards do not match, they stay face up for one and three tenths of a second before turning back over. That number is the game. Make it shorter and the pair is gone before you have read it. Make it longer and every miss becomes a wait. While two wrong cards are on screen the board will not turn a third, and that refusal is the rule, not an oversight in the animation.
Without it, an impatient double tap does something quietly destructive. The first tap turns a card. The second lands on a fresh card, turns it, and that card goes back over inside a reveal you were still reading. You never see it. You have spent a card and learned nothing from it, and nothing on the screen tells you that is what happened.
So taps are sorted by when they arrive. Anything inside the first 450 milliseconds of a reveal is treated as the tail end of the tap that caused it and is dropped outright. Anything later is read as you saying you have seen enough: the two wrong cards go down at once and play carries on, but the card you pressed is not turned. No card should ever be turned before the person who turned it has looked at it.
Why the lock lives in the rules and not in the buttons
The obvious way to build this is to grey the board out for a second and let the buttons do the blocking. It holds until somebody plays with a keyboard, or an event arrives down a path nobody anticipated. Here the refusal sits in the same place as the scoring, so a card turned by a thumb, by the Enter key or by an automated test all meet the identical rule and get the identical answer.
There is a second-order version of the same problem, and it is the one that bites. End a reveal early, turn two more cards, and the timer belonging to the reveal you cut short is still running. Left alone it fires and snatches your new pair off the screen after a third of the usual time, which looks exactly like a bug in your own eyesight. Each reveal therefore carries a serial number, and an expiry that names a reveal which has already ended is thrown away instead of obeyed.
What the board counts, and what it does not
A turn here is a pair of cards, not a single one, so the count only moves when the second card lands. Matched cards stay face up, dimmed and ringed in the page’s own text colour, and pressing one again does nothing whatsoever. When the last pair goes, the board tells you how many turns it took you. There is no clock, no lives and no score to beat, because in a solo matching game the only opponent is the number you managed last time.
What the board will never do is point at a partner. There is no way to ask it where the other star is, and there is nothing to reverse a turn you regret. Both of those would be easy to build and both would take the game apart, because the only thing this board asks of you is the one thing it could trivially do for you.
Sixteen cards, and three other sizes of the same board
The board is four cards by four: sixteen in all, eight pairs, drawn from the first eight of the eighteen faces the engine knows. The other three memory pages run the same engine at three other sizes, and the size is not decoration – it is most of what separates them. The pairs page deals twenty, ten faces rather than eight, and is about how the cards themselves are made: drawn as outlines rather than as little pictures, and never written into the page source where the layout could be read before a single card is turned. The children page comes down to twelve, six pairs, and is about which six faces arrive and why they are chosen rather than sampled. The concentration page opens the board out to thirty and seats two people at it, where finding a pair keeps the turn and watching your opponent play is worth as much as playing. This page is about the second and a bit a mismatched pair stays on screen, which is the thing that decides whether any of it is a game at all. A memory game online needs very little beyond that, and New game deals the sixteen again from scratch whenever you want a fresh order.