Build a memory (concentration) game: a grid of face-down cards; flip two and if they match they stay, otherwise they flip back. Match all pairs to win. The state is small — which cards are face-up right now, and which are permanently matched — and the only timing piece is the brief pause before a non-matching pair flips back.
// A self-contained component. No props.
function App(): JSX.Element;
A grid of cards; flip pairs to match them.
flip card 0 (🍎), flip card 7 (🍎) → match → both stay face-up
flip card 1 (🍌), flip card 2 (🍇) → no match → both flip back after a moment
clicking is ignored while two cards are already face-up, or on a matched card
all pairs matched → "You win!"
flipped (the up-to-2 face-up indices) and matched (a set of solved indices).matched; different → clear flipped after a delay.