//JPB var gb=0x1,x=7,y=6,v=0,jf=0,k=0,db=0,sb=0,sz=0,s; if(env()>0){ s=env(); }else{ s=0; lrun(58); } function er(ex,ey){ uart(0x80,0x0e,0x03,ex,ey,12,255,255,255,255,255,255,255,255); } function ch(cx,cy,it){ uart(0x80,0x06,0x14,cx,cy,it); } function dr(gb){ var j=0,i,g0,g1,g2; while(j<32){ g0=gb>>j&3; g1=gb>>(j+2)&3; g2=gb>>(j+1)&1; if(g0==g1){ j=j+2; } uart(0x80,0x08,0x01,80-j/2*5,42-g2*20,75-j/2*5,42-g2*20,1-g0&1); j=j+2; } } function it(qb,it,iy){ var j=0; while(j<16){ if(qb>>j&1>0){ uart(0x80,0x06,0x14,69-j*5,iy,it); if((j>0)*(qb>>(j-1)&1<1){ uart(0x80,0x0e,0x03,77-j*5,iy,12,248,248,248,248,248,248,248,248); } } j=j+1; } er(0,iy); } function jp(){ var ik,gp; ik=inkey(); gp=gb>>(30-2*x)&3; if((ik==32)*(jf<1)){ jf=1;v=-3; uart(0x80,0x0b,0x09,0,14,0,5,5,255,5,255); } er(x*5-1,y*4+10); er(x*5-1,y*4+7); x=x+(ik==29)*(x<15)-(ik==28)*(x>0); y=y+v; if(jf>0){ v=v+1; }else{ v=1; } ch(x*5-1,y*4+9+s%2,0x0e); ch(x*5-1,y*4+7+s%2,3); if((gp==0)*(y+v>6)){ y=6; jf=0; v=0; } if((gp==2)*(y==1)){ jf=0; v=0; } if((db>>(15-x)&1>0)*(y==-2)){ db=db&~(1<<15-x); s=s+100; uart(0x80,0x0b,0x09,7,7,5,5,5,255,5,255); } if((sb>>(15-x)&1>0)*(y==-2)){ sz=1; sb=sb&~(1<<15-x); k=k+1; if(k>1){ env(s); video(1); sleep(500); lrun(58); } video(0); } if(y+v>6){ er(x*5-1,27); ch(x*5-1,39,1); video(1); env(0); uart(0x80,0x0b,0x09,4,9,5,1,4,255,4,255); sleep(1000); uart(0x80,0x0b,0x09,4,255,5,255,5,255,4,255); exit(); } } function main(){ var d; while(1){ if(rnd(10)<1){ //hole d=(gb&2)+1; }else{ //gr if(gb&1>0){ d=((rnd(4)>0)*2; }else{ d=gb&3; } } gb=(gb<<2)+d; db=(db<<1)+(rnd(10)<1)&0xffff; sb=(sb<<1)+(rnd(10)<1)&0xffff; s=s+1; if(sz>0){ 8 sz=sz+1; } if(sz>31){ sz=0; k=0; video(1); } dr(gb); jp(); it(db,0x35,0); it(sb,0x1e,0); lc(5,10); log("SCORE ",s,"\n"); uart(0x80,0x0b,0x09,5,255,5,255,5,255,5,255); } } cls(); uart("PC IMAGE 06\n"); main();