// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Backward word practice // Not compiled or tested in-world // Setup: Owner-touch, then type the forward spelling of the displayed reverse word. // 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. A short language/pattern toy, separate from an arbitrary letter shuffle. // 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=["garden","planet","window","ribbon","marble"]; string secret; start() { secret=llList2String(words,(integer)llFrand((float)llGetListLength(words))); string reverse=""; integer i; for(i=llStringLength(secret)-1;i>=0;--i)reverse+=llGetSubString(secret,i,i); ask("Read this backward word: "+reverse); } answer(string s) { if(llToLower(s)==secret) { close(); llOwnerSay("Correct: "+secret); } else ask("Try the forward spelling again."); } 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(); } }