// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Domino chain table // Not compiled or tested in-world // Setup: Enter tile index 1-6 to append it to the right. A used tile cannot be selected again. Owner-touch starts a fresh game; type reset to restart. Input times out after 90 seconds. // Stop / restore: Let the input timeout expire or remove the script. No world geometry, avatar or inventory is changed. // Notes: Original compact educational game. Owner-only local input; no scores or avatar identities are sent to a service. Output is short ASCII text. Not a competition authority. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer channel; integer handle; list tiles; list used; integer end; string chain; close() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0.0); } start() { tiles=[0,1,2,3,1,2,3,0,0,2,2,2]; used=[]; end=0; chain="[0]"; } string board() { string s=""; integer i; for(i=0;i<6;++i)if(llListFindList(used,[i])<0)s+=(string)(i+1)+":"+llList2String(tiles,i*2)+"-"+llList2String(tiles,i*2+1)+" "; return chain+" | available "+s; } show() { llOwnerSay(board()); if(!handle) { channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); } llTextBox(llGetOwner(),"Enter tile index 1-6 to append it to the right. A used tile cannot be selected again. Type reset to restart.",channel); llSetTimerEvent(90.0); } default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; close(); start(); show(); } listen(integer incomingChannel,string name,key id,string input) { if(!handle||incomingChannel!=channel||id!=llGetOwner())return; input=llToLower(llStringTrim(input,STRING_TRIM)); if(input=="reset")start(); else { if(llStringLength(input)==1) { integer p=llSubStringIndex("123456",input); if(p>=0&&llListFindList(used,[p])<0) { integer a=llList2Integer(tiles,p*2); integer b=llList2Integer(tiles,p*2+1); if(a==end||b==end) { if(a==end)end=b; else end=a; used+=[p]; chain+="-"+(string)end; if(llGetListLength(used)==6)llOwnerSay("All tiles used."); } else llOwnerSay("No matching endpoint."); } } } show(); } timer() { close(); } }