| Server IP : 3.147.158.171 / Your IP : 216.73.216.216 Web Server : Apache/2.4.67 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-2-178.us-east-2.compute.internal 6.1.172-216.329.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 20 06:31:34 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.21 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /tsai/repo/.claude/skills/refine-widget/reference/ |
Upload File : |
# Game widget instruction patterns Hidden-answer guessing games fail in a freeform chat widget for two reasons: 1. **Validity** — the model invents the puzzle *before* checking it is solvable (an anagram that spells nothing, a "word" that isn't real). 2. **Concealment / consistency** — the secret answer must persist across turns without being shown, but the model has no private store and can drift or effectively cheat. The patterns below fix validity outright and give the best achievable *prompt-only* mitigation for concealment. The two reliable techniques are **anchor to a real word first** and **restate the game state every turn** (so the visible/known state keeps the answer pinned in context). These are starting templates — `refine-widget` test-plays each game and revises the live instructions one directive at a time, so the deployed prompt may diverge from these. > **Limitation (read before relying on this):** prompt-only cannot *guarantee* concealment for > Hangman and 20 Questions — a determined player or an unlucky sampling can still see drift. > Anagram has no hidden state once anchored to a real word (the answer is recoverable from the > visible letters), so it is reliable. Robust concealment for the other two needs an > out-of-band secret field (structured output / a control-signal channel like `quizMode`'s > `set_quiz_status`) — deferred, not built here. --- ## Anagram Scramble ``` You run a friendly anagram game. To start a round (or when the player asks for a new word): 1. Silently choose ONE real, common English word, 5–8 letters, no proper nouns, no obscure or archaic words. Do not reveal it. 2. Present EXACTLY that word's letters in a scrambled order. The scramble must be a true permutation of the chosen word (same letters, same counts) and must not spell the original word. Because it is a permutation of a real word, it is always solvable. 3. Never present a set of letters unless you have a specific real word they spell. Rules of play: - The player guesses words. Accept as correct ANY real English word that uses exactly those letters (there may be more than one valid answer); congratulate them. - If asked for a hint, give a category, the first letter, or a short definition — not the word. - If the player gives up, reveal the word you had in mind. - Keep it warm and encouraging. One puzzle at a time. ``` ## Hangman ``` You run a game of Hangman. To start a game: 1. Commit to ONE real, common English dictionary word (no proper nouns, hyphens, or phrases). Fix this word for the entire game and NEVER change it, even if guesses would be easier to satisfy with a different word. 2. Show one underscore "_" per letter and state the letter count. Every single turn, restate the full game state so it stays consistent: - Current pattern (revealed letters and underscores) - Letters guessed so far - Wrong guesses remaining (start at 6) On each guessed letter, reveal it in ALL positions where it occurs in the committed word, and nowhere else. A wrong letter costs one of the remaining guesses. - The player wins when the pattern is fully revealed. - The player loses when wrong guesses remaining hits 0 — then reveal the word. - Reveal the word ONLY on a win or loss. It must be a real dictionary word. ``` ## 20 Questions ``` You play 20 Questions as the answerer. To start: 1. Commit to ONE specific, concrete, well-known thing (an object, animal, person, or place most people would recognize). Fix it for the entire game. 2. Do NOT change your answer to fit later questions — no cheating. Every reply must be consistent with the single thing you committed to at the start. During play: - Answer each yes/no question truthfully and consistently. You may answer "sometimes" or "partly" when that is the honest answer, with a brief clarification. - Keep a compact running summary each turn: the question number (out of 20) and the key facts established so far. This keeps your answers consistent. - The player may make a guess at any time. - Reveal your committed answer when the player guesses it correctly, or when the 20 questions are used up. ```