Working example + reusable specification
Word Search AI Coding Prompt
Build an untimed word search with separate English and Brazilian Portuguese modes, age-based vocabulary, adjustable grids, and mouse, touch, and keyboard selection.
01 / What it builds
A complete interaction, not a loose concept
Copy a complete AI coding prompt for a word search in English or Brazilian Portuguese, with age presets, selectable board sizes, accessible input, and tests.
- English or Brazilian Portuguese, one language per puzzle
- Three age presets and 8x8, 10x10, or 12x12 boards
- Accented words, overlapping finds, and untimed progress
- Bounded generation and accessible endpoint selection
02 / Complete prompt
Copy the build specification
Project: Word Search Objective Build a complete, untimed browser word search using either English or Brazilian Portuguese. Each puzzle uses exactly one language for its word bank, controls, feedback, and accessible names. Never mix languages within a puzzle. Keep the surrounding catalog and editorial prompt pages in English. Functional Requirements - Start with English, ages 6-8, and an 8x8 board. - Provide independent language, age-group, and board-size selectors. - Ages 6-8: suggest 8x8, six familiar words of 3-5 letters, horizontal and vertical forward placement. - Ages 9-12: suggest 10x10, eight words of 4-8 letters, adding downward diagonals. - Ages 13+: suggest 12x12, ten words of 5-10 letters, all eight straight-line directions. - Allow 8x8, 10x10, and 12x12 overrides for every age group. Filter words to fit the actual board size. - Changing age applies its suggested size. Changing language, age, or size replaces the puzzle and clears progress. New Puzzle retains current settings. - Preserve Brazilian Portuguese accents in the grid and word list. Normalize Unicode to NFC and uppercase using the selected locale. - Use curated, distinct word banks with at least 30 words per language and age preset, including enough words for the smallest board. - Accept straight contiguous words from either endpoint, including alternate occurrences. Reject partial and nonaligned selections; count each target word only once. - Highlight found cells, preserve overlapping highlights, mark found words with a check and strike-through, and display found-word progress and completion. - Add an optional Hide words checkbox (Ocultar palavras in pt-BR), off by default. Conceal unfound list entries from view and assistive technology; reveal each word when found. Toggling preserves the board and progress, New Puzzle retains the choice, and reopening resets it. Do not persist or track this preference. - Do not add a timer, score, hints, custom lists, account, backend, or saved personal age. Keep all puzzle data in memory; reopening starts at defaults. Technical Requirements - Use semantic HTML, responsive CSS, and vanilla JavaScript native modules, without a build step or runtime dependencies. - Separate configuration, localized copy, curated word banks, pure puzzle rules, and DOM controller effects. - Implement the generator in-project with injectable randomness, longest-first placement, same-letter intersections, and bounded backtracking with fresh retries. - Never enlarge the chosen board or silently omit words. Return a recoverable failure if the generation budget is exhausted and offer a new puzzle without exposing an incomplete board. - Keep word-search attributes distinct from other games. Integrate launch, render, stop, restored-screen handling, and the existing hash-based example links. - Use the existing sound preference and consent-gated catalog analytics. Never track age, language, selected words, or puzzle progress. Accessibility and Responsive Behavior - Support mouse dragging and two-click endpoints, touch two-tap endpoints, and native scrolling of the board. - Use a semantic grid with row/column/letter labels, one tab stop, arrow-key navigation, Enter or Space endpoint selection, and Escape cancellation. - Keep cells and controls at least 44px. On small screens, scroll only the board region horizontally, never the document; scroll focused cells into view. - Keep selection and found states distinguishable without color alone. Announce results in the selected language and respect reduced motion. - Cancel transient input on navigation, loss of focus, pointer cancellation, and opening shared dialogs. Do not intercept game keys inside dialogs or selectors. Acceptance Criteria - Test all 18 language/age/size combinations with multiple deterministic seeds, exact board dimensions, requested word counts, permitted placements, and no missing words. - Test Unicode accents, invalid settings, generation exhaustion, overlaps, reverse selection, duplicates, alternate occurrences, and completion. - Test mouse, keyboard, and touch journeys; language and size resets; modal isolation; reopening; and no puzzle persistence. - Verify 320px mobile, portrait and landscape phones, desktop layouts, visible focus, and 44px targets across Chromium, Firefox, and WebKit. Deliverables - Working game integrated into the existing example catalog. - Canonical copyable prompt page, metadata, sitemap entry, and a real 1200x630 game screenshot. - Focused automated tests and local run instructions.