Matching Pairs Game
Turn over two cards – if they match, the pair is yours and you go again. If not, they are turned face down. Remember where everything is and you win.
How it is calculated
How to play
- Choose the board, the number of players and the pictures. Every picture appears exactly twice.
- On each move, tap two cards. If they match, they stay face up, count as a pair for the current player, and that player goes again.
- If they differ, they are turned back after one second and it is the next player’s turn.
- When all pairs are found, whoever has the most wins. Solo, your moves and time count.
On a computer everything works by keyboard too: Tab jumps into the board, the arrow keys move, Enter or Space turns a card.
Fairly shuffled
Before each game the cards are shuffled with the Fisher–Yates algorithm; the random numbers come from the browser’s crypto.getRandomValues() (W3C Web Cryptography API) without modulo bias. Every layout is equally likely and nobody can predict the board.
How many moves is good?
Even with perfect memory you cannot avoid some guessing. Velleman and Warrington showed in the American Mathematical Monthly (2013) that with n pairs an optimal player needs on average about (3 − 2 ln 2) · n + 7/8 − 2 ln 2 ≈ 1.61 · n moves. With 8 pairs (16 cards) that is about 12 moves, with 18 pairs about 29. After a solo game the tool shows this value for comparison – as a guide, not a grade.
Notes
- For children, 12 or 16 cards with animals work well; 6 × 6 with numbers is a challenge for adults.
- In multiplayer mode you pass one device around; the player whose turn it is appears above the board.
- The game state is not saved and nothing is sent. Board size, players and pictures are part of the link and can be shared.
Frequently asked questions
How does the matching pairs game work?
All cards start face down. On each move two are turned over; a matching pair is kept and the player goes again, otherwise both are turned back. Whoever has the most pairs at the end wins.
Can two people or kids play together?
Yes, 2 to 4 players can share one device. Scores are shown above the board and the current player is highlighted. For young children, 12 cards with animals are ideal.
How many moves does it take on average?
With perfect memory and the best strategy, about 1.61 moves per pair (Velleman and Warrington, 2013) – roughly 12 for 16 cards. Anything below that means lucky guesses.
Are the cards really shuffled randomly?
Yes. They are shuffled with the Fisher–Yates algorithm using the browser’s cryptographic random numbers, so every layout is equally likely.
Does the game work on phones and tablets?
Yes, in any current browser. The cards adapt to the screen width; on small phones 4 × 4 is the most comfortable size.
Sources and legal basis
- Velleman D. J., Warrington G. S. (2013): What to Expect in a Game of Memory. American Mathematical Monthly 120(9), 787–805
- Chakrabarti A., Chen Y. (2017): Time-Space Tradeoffs for the Memory Game, arXiv:1712.01330 (Einleitung: T(n) nach Velleman/Warrington)
- W3C Recommendation: W3C Web Cryptography API – getRandomValues()
- MDN Web Docs – Crypto.getRandomValues()
As of:
Related tools
- Play the 2048 game onlinePlay 2048 free in your browser: swipe or use the arrow keys to merge tiles until you reach 2048. With best score, one-step undo and your game saved.
- Play the mines game onlineFree mine puzzle in your browser: beginner, intermediate and expert, first click always safe, flags by long press or right click, best times. No app or sign-up.
- Play tic tac toe onlineFree tic tac toe in your browser: play against the computer (easy, medium, unbeatable) or two players on one device, with a running score. No sign-up.
- Roll dice online: d6, d20 and moreOnline dice roller: roll 1–10 dice with 4, 6, 8, 10, 12 or 20 sides, d6 with dots, total, roll history and exact odds. Fair cryptographic randomness.
- Aim Trainer OnlineFree online aim trainer: hit 30 targets against the clock or as many as you can in 30 seconds. Three target sizes, accuracy and average time per target.
- Bingo Card GeneratorFree printable bingo cards: 75-ball (B-I-N-G-O), 90-ball with strips of 6 or your own words. Numbered, print-ready on A4 or Letter, with caller and card check.