_='~LX^_.round(t*H)/HUX^t[tq-1]Z{Kk=5+40*G(|Ii=0zI`k|k+=G-(k?.5:0^IP{Nt=d.createElemtcanvas"width=Jheight5Js.padding="1px",b.appdChild(tNi@an@v=Z(|e@o!getC2d"e.R=e7Rect,e.T=e7Text,e6=S6,onmousedown=XNen1=!which?e<D&&(i`e|D-=e):iq&&(i.pop(|D+=e)}OX~eXn7S=t}Nn!o,o!v,r!a;K000JJJ150|M=Jm/Jizm=V<m?V:m,M=V>M?V:M;KizBBF3*i,150-(5+(V-m)/(M-m)*145|3,3if(FFF"|jM|jm140|Bo|W=rq,jB85|W){Ks=Ji=0;i<Ws+=r[i];s/=W,e(B<s?"red":"#0F0"|js)+"+W+")",H,85)}E{u=Aq,u<&&A`new P|Y=A[Q%].v;NiY)+G-.5;KY`i&&U(Y)?i:0|Y.shift(|Q++,l=0;l<u;l++)O(A[l]innerHTML=L(D|setTimeout(E,)}d=documt,b=d.body,H0J_=Math,G=_.random,d.addEvtListercmu",e=>e.prevtDefault|d.write<h3 id=\'t\'/>"|S=b.s,S6="px Arial",AQ=JD=999,E(~ |),z;i<Hq.lgthjn.T(L(`.push(^return X(t){Vo[i]Nvar Kfor(J0,@=this.7.fill6.font!=function(");entyle=[],30"|n.R(ontext()t.;i++)e#|1J=U(}~>0=1';for(Y in $="!67@JKNVX^`jqz|~")with(_.split($[Y]))_=join(pop());eval(_)
d = document;
b = d.body;
H=100;
_ = Math;
G = _.random;
function L(x){
return _.round(x*H)/H;
}
d.addEventListener('contextmenu', e=>e.preventDefault());
d.write("<h3 id='t'/>");
S = b.style;
S.font="30px Arial";
function U(a)
{
return a[a.length-1];
}
function Z()
{
k = 5+40*G();
I = [];
for(i=0; i<H; i++)
{
I.push(k);
k += G()-(k>0?0.5:0);
}
return I;
}
//panel
function P()
{
var c = d.createElement("canvas");
c.width=300;
c.height=150;
c.style.padding="1px";
b.appendChild(c);
var a = this.a = [];
var v = this.v = Z();
var o = this.o = c.getContext("2d");
o.R = o.fillRect;
o.T = o.fillText;
o.font=S.font;
function K(e) {
var w = U(v);
if(e.which==1)
{
if(w<D){
a.push(w);
D-=w;
}
//alert(self.a);
}
else if(a.length>0)
{
a.pop();
D+=w;
}
}
c.onmousedown = K;
}
function O(p)
{
var o = p.o;
function q(a){o.fillStyle=a}
var v = p.v;
var a = p.a;
q("#000");
o.R(0,0, 300, 150);
M = 0;
m = 1/0;
for(i=1; i<H; i++)
{
m = v[i]<m?v[i]:m;
M = v[i]>M?v[i]:M;
}
for(i=1; i<H; i++)
{
q("#BBF");//v[i]>v[i-1]?"#0F0":"red";
//alert(this.y + interp(mini, 0, maxi, 100, this.v[i]));
o.R(3*i,
150 - (5 + ((v[i] - m) / (M - m))*(145)),3,3);
}
q("#FFF");
o.T(L(M), 10,30);
o.T(L(m), 10,140);
//q("#FF0");
B = U(v);
W = a.length;
o.T(L(B), 10,85);
if(W>0)
{
s = 0;
for(i=0; i<W; i++)
{
s+=a[i];
}
s = s/W;
q(B<s?"red":"#0F0");
//alert(uh);
o.T(L(s)+"("+W+")", H,85);
}
}
A = [];
Q = 0;
D = 999;
function E()
{
u = A.length;
if(u<30){
A.push(new P());
}
Y = A[Q%30].v;
var v = U(Y)+G()-0.5;
Y.push(v>0 && U(Y)>0?v:0);
Y.shift();
Q++;
for(l=0; l<u; l++)
{
O(A[l]);
}
t.innerHTML = L(D);
setTimeout(
E
, 30
);
}
E();