Moves 0Pairs 0/8
Memory Match
Find eight matching pairs with as few moves as you can.
Build notesUnder the hood, without the lecture
The whole board is data: sixteen symbols, two open indexes, and a list of completed pairs. There is no game engine hiding behind it.
Two cards are a conversation
The click guard refuses a third card, an already-open card, or a completed pair. Once two are open, they stay visible for 550 milliseconds before the board decides whether they match.
Why matched symbols, not indexes?
Every symbol appears exactly twice, so storing the matched symbol reveals both cards naturally. It also keeps completion as simple as comparing the number of matches with the number of unique marks.
if (
!playing || open.length === 2 ||
open.includes(index) || matched.includes(deck[index])
) return;