Build an Emoji Memory Card Matching Game with Star Rating in One HTML File
You get a polished, original emoji memory matching game in a single HTML file, with three grid sizes, a move counter, a timer, keyboard navigation and a 1–3 star rating.
The prompt
Act as a senior front-end developer and game designer who ships accessible, polished browser games.
Build Tide Pool Pairs, an original memory card matching game with an ocean theme. Players flip cards two at a time to find emoji pairs of sea creatures, such as an octopus, crab, turtle and whale, and try to clear the board in as few moves and as little time as possible.
Rules:
1. Grid sizes: offer three choices, Small 4x3, Medium 4x4 and Large 5x4, as a segmented control. Changing the size or pressing New Game reshuffles the board. Cards keep a 3:4 ratio and scale to fit any width from 360 to 1280px.
2. Scoring: count one move per pair flipped. Start a timer on the first flip. Show moves, time, pairs found and a live 1–3 star rating based on both moves and time relative to the number of pairs.
3. Flip: use a 3D CSS flip. Under prefers-reduced-motion, cards change instantly. Mismatched cards flip back after a short pause. Matched cards stay up with a teal outline.
4. Accessibility: the cards are buttons using a roving tabindex. Arrow keys, Home and End move focus, and Enter or Space flips the focused card. Each card has a descriptive aria-label, and an aria-live region announces matches.
5. Sound: soft Web Audio tones for flip, match, miss and win, created on first interaction, with a visible mute toggle.
6. Style: deep navy background, warm amber accent, cream card faces. Show a win panel with the stars, the final stats and a Play Again button.
Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.Example output
Tips and common edits
Why this works
- Fixed grid sizes and an even card count guarantee a solvable board, so the shuffle never breaks the game.
- Cards are real buttons with a roving tabindex, so keyboard, touch and screen reader support work without extra tricks.
- A lock flag plus a game ID stop fast clicks or resets mid-flip from leaving cards stuck face up.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as tide-pool-pairs.html and open it in any browser, or run it in the chat's canvas or preview pane. No setup or internet connection is needed.
Common edits
- Swap the emoji and name lists for a different theme, such as fruit, space or animals, and adjust the palette variables.
- Tighten the star thresholds in the rating function to make three stars harder, or add a 6x5 Expert grid size.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build a Color Sequence Memory Game with Synth Tones in One HTML File
A ready-to-paste prompt that builds Echo Garden, a four-pad color-and-shape sequence memory game with Web Audio tones, a strict mode and rising speed.
Build a Match-Three Tile Swapping Puzzle with Cascades and Combo Scoring
Generates a complete single-file match-three puzzle with swap validation, gravity refill, chain-reaction combo scoring and an automatic reshuffle when no moves remain.
Build a One-Button Fox Endless Runner Game in a Single HTML File
A ready-to-paste prompt that produces Ember Fox Dash, a polished one-button forest runner with coyote-time jumps, fair obstacle spacing, rising speed and synthesized sound.
Build a Reaction Time Tester Game with False-Start Detection in One HTML File
Get a polished reaction time test with random delays, false-start penalties, a five-attempt average and an SVG results chart, all in one HTML file.
Build a Word Scramble Puzzle Game with Hints, Categories and Streaks in HTML
A prompt that produces a single-file word scramble game with themed categories, paid letter hints, streak bonuses, and both typing and tile-tapping controls.
Build a Daily Five-Letter Word Guessing Game with Colorblind Mode in One HTML File
A ready-to-paste prompt that produces Quillmark, an original daily five-letter word game with correct duplicate-letter coloring, an on-screen keyboard and a colorblind mode.