Overview
This prompt aims to enhance an existing programming project by adding two new two-player games. Programmers and developers will benefit by learning how to integrate new functionalities while maintaining existing code structure.
Prompt Overview
Purpose: This document outlines the implementation of two new two-player games in an existing programming interface.
Audience: The intended audience includes developers and programmers looking to enhance their coding projects with new game features.
Distinctive Feature: The new games, Checkers and Dots and Boxes, will integrate seamlessly with the existing UI and gameplay logic.
Outcome: Users will enjoy an enriched gaming experience with additional options while maintaining the current interface’s structure and style.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Development Tools & DevOps
- Techniques: Function Calling / Tool Use, Role/Persona Prompting, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
Add two additional two-player games to the provided HTML and JavaScript code for two-player games, enhancing the existing interface with minimal disruption.
**Details:**
– Maintain the current structure, style, and theming (light/dark mode).
– New games must have their own buttons in the selection area and corresponding game containers with appropriate UI elements.
– Implement the core gameplay logic for both new games in JavaScript, supporting human vs human and human vs AI modes where applicable.
– Include reset buttons and return-home buttons consistent with existing games.
– Ensure the new games integrate smoothly with the existing game selection, display toggling, and mode toggling.
**Suggested Games:**
– “Checkers”: A standard 8×8 checkers game with two players moving pieces diagonally and capturing opponent pieces.
– “Dots and Boxes”: Players take turns connecting dots on a grid to complete boxes, scoring points for each completed box.
**Steps:**
1. Add two new buttons to the main game selection area:
– “Play Checkers”
– “Play Dots and Boxes”
2. Create two new game-container div sections, each with:
– A heading with the game name.
– Player type selector for Human vs Human or Human vs AI.
– The game board UI relevant to the game.
– Instructions for how to play.
– Reset and Home buttons.
3. In JavaScript, add logic to manage:
– Game creation
– Rendering
– Player moves
– AI moves (basic random or simple heuristics)
– Win/draw detection
– Resetting for each new game.
4. Augment the `selectGame()` function to support these new games, showing/hiding appropriate containers and initializing game state.
5. Ensure styling matches existing games, with intuitive controls and visible feedback for players.
**Output Format:**
Provide the full modified HTML code with inline JavaScript and CSS, including the original code plus the two new games fully implemented according to the above requirements.
Screenshot Examples
How to Use This Prompt
- Copy the prompt for game enhancement instructions.
- Identify existing HTML structure for game selection area.
- Add buttons for “Play Checkers” and “Play Dots and Boxes”.
- Create new game-container sections with necessary UI elements.
- Implement JavaScript logic for game functionality and player interactions.
- Test integration with existing game selection and styling.
Tips for Best Results
- Add Game Buttons: Include “Play Checkers” and “Play Dots and Boxes” buttons in the game selection area.
- Create Game Containers: Design separate containers for Checkers and Dots and Boxes with game-specific UI elements and instructions.
- Implement Game Logic: Write JavaScript functions for managing game state, player moves, and win detection for both new games.
- Integrate with Existing Code: Modify the `selectGame()` function to toggle visibility of new game containers and ensure consistent styling throughout.
FAQ
- What are the new games added to the existing code?
The new games added are Checkers and Dots and Boxes. - How do players select game modes?
Players can choose between Human vs Human or Human vs AI modes for each game. - What UI elements are included for each new game?
Each game has a heading, player type selector, game board, instructions, and buttons. - What functionality does the JavaScript code provide?
The JavaScript manages game creation, rendering, player moves, AI moves, and win detection.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


