var got; var score,index; var handX=15; var laneY=10; var remain=10; function init(){ cls(); score=0; index=0; got=new Array(remain); } function result(){ lc(0,0);log("you caught..."); var code=got[index]; lc(13,0);log(index+1); lc(index,1);log(chr(code)); score=score+code%5; lc(0,2);log("score:",score); index=index+1; if(index>=remain){ lc(0,3); if(score<10){ log("bad..."); }else{ log("good!"); } exit(); }else{ setTout(result, 1000); } } function main(){ if(rnd(10)==0){ var item=chr(rnd(16)+229); lc(0,laneY);log(item); } if(btn()==1){ got[index]=scr(handX,laneY); lc(handX,laneY);log(" "); index=index+1; } lc(handX,laneY+1);log(" "); lc(handX,laneY+2);log(" "); scroll(1); lc(handX,laneY+1);log(chr(226)); lc(handX,laneY+2);log(remain-index); if(index>=remain){ index=0; result(); return; } setTout(main,100); } init(); main();