var nx; var flag; var sy; var key; var score; var i; var a; sy = 22; nx = 0; flag = 0; score = 0; while(1){ if((nx == 15) * (sy != 22)){ score = score + 1; } key = inkey(); if((key == 32) * (sy == 22)){ sy = sy - 5; } if(sy < 22){ sy = sy + 1; } i = rnd(10); if(flag == 0){ if((nx < 30) * (i <= 2) * (nx != 14)){ nx = nx + 2; } if((nx < 30) * (i > 2) + (nx == 14)){ nx = nx + 1; } if(nx >= 30){ nx =nx - 1; flag = 1; } } else{ if((nx > 0) * (i <= 2) * (nx != 16)){ nx = nx - 2; } if((nx > 0) * (i > 2) + (nx == 16)){ nx = nx - 1; } if(nx <= 0){ nx = nx + 1; flag = 0; } } cls(); lc(0, 0); log("SCORE:"); log(score); lc(nx, 22); log("_"); lc(15, sy); log(chr(0xEC)); if((nx ==15 )*(sy == 22)){ lc(11, 12); log("GAME OVER"); break; } sleep(40); }