// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Letter-reveal word puzzle // Not compiled or tested in-world // Setup: Owner-touch, then submit one ASCII letter per guess. Edit WORDS to change the vocabulary. // Stop / restore: Stop responding and the listener closes after 90 seconds, or remove/disable the script. Owner-touch restarts the exercise. // Notes: Owner-only local exercise; no prizes, visitor records, network service, or persistent scores. No gallows or violent imagery; wrong guesses simply use the six-miss budget. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer channel; integer handle; close() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0.0); } ask(string prompt) { if(!handle) { channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); } llTextBox(llGetOwner(),prompt,channel); llSetTimerEvent(90.0); } list WORDS=["texture","sculpture","lantern","workshop","particle"]; string secret; string guessed; integer misses; string view() { string out=""; integer i; for(i=0;i=0)out+=c; else out+="_"; } return out; } start() { secret=llList2String(WORDS,(integer)llFrand((float)llGetListLength(WORDS))); guessed=""; misses=0; ask(view()+"\nGuess one letter."); } answer(string s) { s=llToLower(s); if(llStringLength(s)!=1||llSubStringIndex("abcdefghijklmnopqrstuvwxyz",s)<0) { ask(view()+"\nOne letter a-z."); return; } if(llSubStringIndex(guessed,s)>=0) { ask(view()+"\nAlready guessed. Try another."); return; } guessed+=s; if(llSubStringIndex(secret,s)<0)++misses; if(view()==secret) { close(); llOwnerSay("Solved: "+secret); return; } if(misses>=6) { close(); llOwnerSay("Word was "+secret); return; } ask(view()+"\nMisses "+(string)misses+"/6. Tried: "+guessed); } default { touch_start(integer count) { if(llDetectedKey(0)!=llGetOwner())return; close(); start(); } listen(integer ch,string name,key id,string message) { if(!handle||ch!=channel||id!=llGetOwner())return; answer(llStringTrim(message,STRING_TRIM)); } timer() { close(); llOwnerSay("Exercise paused. Touch to restart."); } changed(integer change) { if(change&CHANGED_OWNER)llResetScript(); } }