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

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

One HTML file. Save it and open it in any browser.Open full screen

Example: Tide Pool Pairs, an ocean-themed emoji memory game.

Pick a board size (Small, Medium or Large), then click or tap cards to find matching sea creatures. Keyboard players can move between cards with the arrow keys and flip with Enter or Space. The HUD tracks moves, time, pairs found and a live star rating. Clear the board to see your final stars, and try for three on the Large grid. Use the speaker button to mute the soft synthesized tones.

Written by AI from this prompt. Your results will vary.

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 in Simple HTML Games