for(_='),|"|%(i[$+"J"+I",V+VIU])Uv$_")+EJ^="9S[T]98%Y$7olor6 c6tJ>ent(),(aisut],c[thw(v$<br>("in9500pxVS.rgb+erbordclick])- Attribe(FQ(t).style=a=>=>d.quySelector\\".nHTMLb9VR=~~(255*Ma.random|c=[E9Vt9btonVF9dabledVC`<div id=`+a+`></div>`,Q|Wa.valueAsNumb,vNaN(W))?0:W|wMa.abs|T9C6VN=0,K=0,p=8whiteVY=,e)=>{C=a.,C.c6=e,C.C6=e},M9Vb..textAlign9cVH=`<p max=255 m=0 type=numb =wid:50px>`,b+9<h1>What ?</h1>ICq^HUHUHJ)IEJ<ICHECK</IIE+CQ^<It+` on=r>RETRY</`+VA=Q#q%S=A.,S.9solidVpS.heightwidmarg90 aoVi=Allp70"red71"#0A072"#00F%L=Q#Q%r={c=[RRRk90]U1]U2]J)VS.background=k,premove|L=M},on={P=0 0 -1 1 -2 2]|++K,N+=P,M9Pot avage: I~~(N/K)J IKJs(The low e bett)VL9The was: IkJ. Your guess was off by IPJ potsIE+M,8v$0_1_2])J)Vset,F)},rb.addEvLtenkeyupV{13===ev.keyCode&&});';G=/[-6-9^_UVIJ$%|]/.exec(_);)with(_.split(G))_=join(shift());eval(_)
b.innerHTML='';
R=()=>~~(Math.random()*255);
c=[];
E='<br><br>';
t='button';
D='disabled';
C=A=>'<div id="'+A+'"></div>';
Q=A=>d.querySelector(A);
W=A=>A.valueAsNumber;
v=A=>isNaN(W(A)) ? 0 : W(A);
w=A=>Math.abs(A);
T='borderColor';
Z=0;
U=0;
p=()=>S[T]='white';
Y=(A,B)=>{C=A.style;C.color=B;C.borderColor=B};
X='';
b.style.textAlign = 'center';
I='<input max=255 min=0 type="number" style="width:50px">';
b.innerHTML+='<h1>What color is this?</h1>'+C('q')+E+'rgb('+I+','+I+','+I+')'+E+'<'+t+'>CHECK'+'</'+t+'>'+E+C('Q')+E+'<'+t+' onclick="r()">RETRY</' + t + '>';
B=Q('#q');
S=B.style;
S.border='solid';
p();
S.height='500px';
S.width='500px';
S.margin='0 auto';
i=d.querySelectorAll('input');
Y(i[0],'red');
Y(i[1],'#0A0');
Y(i[2],'#00F');
V=Q('#Q');
r=()=>{
c=[R(),R(),R()];
k='rgb('+c[0]+','+c[1]+','+c[2]+')';
S.background=k;
p();
Q(t).removeAttribute(D);
V.innerHTML=X;
}
Q(t).onclick=()=>{
P=((w(v(i[0])-c[0])) - -(w(v(i[1])-c[1])) - -(w(v(i[2])-c[2])));
++U;
Z+=P;
X='Point average: ' + ~~(Z/U)+' in '+U+' colors<br>(The lower the better)';
V.innerHTML= 'The color was: ' + k + '. Your guess was off by ' + P + ' points'+E+X;
S[T]='rgb('+v(i[0])+','+v(i[1])+','+v(i[2])+')';
Q(t).setAttribute(D,D);
};
r();
b.addEventListener('keyup', e =>{
if (event.keyCode === 13)Q(t).click();
});