Working example + reusable specification

Number Sequence Game AI Prompt

Build a Simon-style memory game with four distinct signal pads, expanding sequences, generated tones, progressive playback speed, and deterministic rules.

Number Sequence working browser example

01 / What it builds

A complete interaction, not a loose concept

Copy a complete AI coding prompt for a Simon-style number sequence game with tones, progressive speed, accessible controls, persistence, and tests.

02 / Complete prompt

Copy the build specification

Project: Number Sequence

Objective
Build a complete Simon-style memory game in which players watch and hear an expanding sequence, then reproduce it using four numbered signal pads.

Functional Requirements
- Present four stable pads identified by number, color, shape name, and distinct tone.
- Add one randomly selected pad to the sequence after every completed round.
- Lock player input while the sequence is playing and enable it only after playback finishes.
- End the run immediately when the player chooses an incorrect pad and identify the expected response.
- Provide Start, Replay Sequence, Restart, and All Games actions.
- Allow one replay per round and gradually increase playback speed at defined round thresholds.
- Display the current round, best completed round, and input progress.
- Persist only a validated best-round value in localStorage.

Technical Requirements
- Use semantic HTML, responsive CSS, and vanilla JavaScript with native modules.
- Keep sequence generation, phase transitions, input validation, and scoring independent from DOM and timer effects.
- Inject randomness into pure sequence rules so automated tests remain deterministic.
- Use the Web Audio API for distinct generated tones without external audio assets.
- Cancel playback timers and invalidate stale callbacks when restarting or leaving the game.

Accessibility and Responsive Behavior
- Support touch, mouse, number keys 1 through 4, and Arrow-key focus movement.
- Use actual buttons with accessible labels and never communicate pad identity using color alone.
- Include live status feedback, visible focus, reduced-motion support, and targets at least 44px high.
- Keep the board stable without horizontal overflow in mobile portrait, landscape, and desktop layouts.

Acceptance Criteria
- Each completed round adds exactly one valid pad to the existing sequence.
- Input is rejected during playback and accepted in order during the player phase.
- Correctly reproducing the sequence advances one round; one incorrect input ends the run.
- Each round permits no more than one replay.
- Restarting or navigating away prevents old playback callbacks from modifying the game.
- Valid best-round data survives reload while malformed persisted data is removed.
- Automated tests cover deterministic generation, phase transitions, scoring, replay, persistence, keyboard input, and lifecycle cleanup.

Deliverables
- The complete playable game as the primary experience, not a landing page.
- Modular application source and focused automated tests.
- No gameplay network dependency or external audio assets.

Provided by www.my-ai-prompts.com