Game Code Prompts: 8 Prompts for Gemini and Claude
Game code prompts that make Gemini or Claude write a working HTML game in one go: a memory card game plus 7 variants; works in ChatGPT and Entrobase Builder too.
Prompt
Fill in the fields below and the prompt updates instantly. Copy it and use it in any AI tool.
Write a memory card game called Find the Pair as a single HTML file that runs in the browser.
Goalthe player flips face-down cards two at a time and finds every pair in as few moves as possible.
Board4x4, 16 cards, 8 pairs. Cards are shuffled, a new order every game.
Card facesfruits (apple, pear, cherry, lemon and so on); each drawing is simple, flat-colored SVG, no emoji or image files.
Card backsa fine light line pattern on the main color #d9653b.
Play
A clicked card flips open; if two cards match they stay open and fade slightly.
If not, both close after 1 second; a third card can't be clicked meanwhile.
Top stripmoves, time (starts on the first click), pairs found and a "Restart" button.
Endwhen all pairs are found, a result card shows moves, time, 1-3 stars (by moves) and the best time.
Savingthe best time is stored in the browser (localStorage).
Designcream background, rounded cards, a bold serif heading, legible sans-serif text. Cards fit the screen on phones.
Textshort interface copy; no names or characters from existing games.
Design preview made from this prompt

7 more ready-to-use prompts
Different takes on the same topic. Copy any of them as is and replace the parts in square brackets.
1.Snake game code prompt
When to use: When you want the classic snake game in one file.
Write a snake game as a single HTML file.
- Board
- 20x20 squares; arrow keys and swipes on phones.
Each food is 10 points and grows the snake; hitting itself or a wall ends the game.
Best score in localStorage.
- Look
- dark background, [color] snake, pixel feel.
2.Number merge puzzle code
When to use: When you want a sliding tile puzzle.
Write a 4x4 number merge puzzle as a single HTML file.
Arrow keys and swipes slide all tiles; two equal numbers merge into their sum.
A 2 or 4 appears in a random empty square after each move.
Score and best score; "Game over" when no moves are left.
Tile colors darken as numbers grow.
3.Brick breaker game prompt
When to use: When you want a paddle-and-ball game.
Write a brick breaker game with Canvas in a single HTML file.
A paddle moved by mouse or touch, a bouncing ball, 5 rows of colored bricks.
3 lives, a score, and a slightly faster next level when all bricks are gone.
Don't use the name of an existing game.
4.Balloon pop game for kids
When to use: When you want a one-tap game for young kids.
Write a balloon pop game as a single HTML file.
Colorful balloons rise from the bottom; tapping pops them for +1 point.
60-second rounds with the score and "Play again" at the end.
Big balloons and soft colors.
5.Word guessing game code
When to use: When you want a daily five-letter word puzzle.
Write a five-letter word guessing game as a single HTML file.
6 tries; green for the right letter in the right spot, yellow for right letter wrong spot, grey otherwise.
An on-screen keyboard and a list of 50 common words.
Name it [name]; don't use the name of an existing game.
6.Two-player connect four for Claude
When to use: When two people will play on one device.
Write a connect four game with 7 columns and 6 rows as a single HTML file.
Players take turns dropping discs; four in a row horizontally, vertically or diagonally wins.
Highlight the winning four; a scoreboard and "New game".
- Colors
- [color 1] and [color 2].
7.Publish the game with Entrobase Builder
When to use: When you want the game on its own site with a how-to-play section.
Build a single-page website for a memory card game called [game name].
- Sections
- top bar, game area, how to play, a 4-question FAQ, footer.
- Game
- 4x4 cards, move and time counters, best time saved in the browser.
- Design
- cream background, main color [color], rounded cards.
What this prompt does
If you want a game code prompt that Gemini or Claude turns into a working HTML game on the first try, the main prompt writes a memory card game with flipping, matching, a move counter and a saved best time, all in one file. The 7 variants below use the same structure for snake, a number merge puzzle, brick breaker, a balloon game, word guessing and connect four.
Where to use it
- Gemini Canvas games
- Claude Code game projects
- Memory games for kids
- Coding class exercises
- A mini game for a website
Fields you can fill in
The fields you can change in the form above and their default values.
- Game nameFree text
- Find the Pair
- DifficultyOne of 3 options
- 4x4, 16 cards, 8 pairs
- Card themeOne of 4 options
- fruits (apple, pear, cherry, lemon and so on)
- Card back colorColor
- #d9653b
Step by step
- 1
Open Canvas in Gemini or a chat in Claude
Paste the prompt into Gemini with Canvas on, or into Claude; both write the code and run the game in a preview panel.
- 2
Choose difficulty and card theme
Start with 4x4; 6x6 can feel small on phones. Letters and numbers make it a preschool learning game.
- 3
Play, then fix one thing at a time
Check flipping, the close delay and the result card. Ask for one change per message, such as 'close cards after 1.5 seconds'.
- 4
Share it or publish it as a site
Gemini Canvas gives you a share link; Use Prompt builds the same game as a website in Entrobase Builder.
Tips and variations
- Keep the 'single HTML file' line; the game then runs without separate CSS or JS files.
- 'SVG, no emoji' keeps card art identical on every device.
- Set star limits with numbers: '12 moves or fewer is 3 stars, up to 18 is 2 stars'.
- For sound, add 'a short chime on a match, using Web Audio, no files'.
Frequently asked questions
What is a good game code prompt?
One that states the goal, board, controls, scoring, game-over state and look on separate lines, and asks for a single HTML file. The prompts on this page follow that pattern.
Can Claude Code make a game?
Yes. Give Claude Code this prompt and ask it to save index.html; it creates the file in your folder. In the Claude chat app the game runs as an artifact.
How do I make a game with Gemini?
Turn on Canvas, paste the prompt and send. Gemini writes the HTML and plays it in the preview; ask for changes in the same chat.
How do I save the game code?
Copy the code into a file ending in .html and open it with a double click; it runs in any browser.
Will the game work on phones?
The prompt asks for cards that fit small screens and respond to taps, so it plays on phones too.





