master
1function(context, args) { // t:#s.user.loc
2 var l = #s.scripts.lib();
3 const c=["red", "purple", "blue", "cyan", "green", "lime", "yellow", "orange"];
4 const o=["open", "unlock", "release"];
5 const t = ["EZ_25", "EZ_35", "EZ_40", "c001", "c002", "c003", "ez_digit", "prime", "color_digit", "complement", "c003_triad_1", "c003_triad_2"];
6 const triad=(function(){const r={};for(let i=0;i<8;i++){r[c[i]]=[c[(i+5)%8],c[(i+3)%8]]}return r;})();
7 const keys={
8 [t[0]]:o,
9 [t[1]]:o,
10 [t[2]]:o,
11 [t[3]]:c,
12 [t[4]]:c,
13 [t[5]]:c,
14 [t[6]]:[0,1,2,3,4,5,6,7,8,9],
15 [t[7]]:[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,73,79,83,89,97],
16 [t[8]]:{[c[0]]:3,[c[1]]:6,[c[2]]:4,[c[3]]:4,[c[4]]:5,[c[5]]:4,[c[6]]:6,[c[7]]:6},
17 [t[9]]:{[c[0]]:c[4],[c[1]]:c[5],[c[2]]:c[6],[c[3]]:c[7],[c[4]]:c[0],[c[5]]:c[1],[c[6]]:c[2],[c[7]]:c[3]},
18 [t[10]]: pc => triad[pc][0],
19 [t[11]]: pc => triad[pc][1],
20 };
21
22 const keys=(function(){
23 const r={};
24 for(let i=0;i<6;i++){if(i<3)r[t[i]]=o;else r[t[i]]=c;}
25 r[t[6]]=[0,1,2,3,4,5,6,7,8,9];
26 r[t[7]]=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,73,79,83,89,97];
27 r[t[8]]=(function(){const z={};for(let y of c){z[y]=y.length}})();
28 r[t[9]]=(function(){const z={};for(let [i,y]of c.entries()){z[y]=(i+4)%8}})();
29 r[t[10]]: z=>triad[z][0];
30 r[t[11]]: z=>triad[z][1];
31 })();
32
33 return { ok:false };
34}