var x; var y; var key; var v; var coin1; var coin2; var coin3; var coin4; var coin5; var point; x = 1; y = 4; v = 0; coin1 = 0; coin2 = 0; coin3 = 0; coin4 = 0; coin5 = 0; point = 5; while(1){ key = inkey(); if((key == 28) * (v == 0)){ if(x > 0){ x = x - 1; } } if((key == 29) * (v == 0)){ if(x < 30){ x = x + 1; } } if((key == 30) * (v == 0)){ y = y - 4; } if((key == 31) * (v == 0)){ v = 1; } if(v > 0){ y = y + 1; v = v + 1; if(v > 4){ v = 0; } } if((x ==12) * (y == 4) * (coin1 == 0)){ point = point - 1; coin1 = 1; } if((x == 18) * (y == 8) * (coin2 == 0)){ point = point - 1; coin2 = 1; } if((x == 4) * (y == 12) * (coin3 == 0)){ point = point - 1; coin3 = 1; } if((x == 21) * (y == 16) * (coin4 == 0)){ point = point - 1; coin4 = 1; } if((x == 0) * (y == 20) * (coin5 == 0)){ point = point - 1; coin5 = 1; } cls(); lc(0, 5); log("================================"); lc(0, 9); log("================================"); lc(0, 13); log("================================"); lc(0, 17); log("================================"); lc(0, 21); log("================================"); lc(28, 0); log("$="); log(point); if(coin1 == 0){ lc(12, 4); log("$"); } if(coin2 == 0){ lc(18, 8); log("$"); } if(coin3 == 0){ lc(4, 12); log("$"); } if(coin4 == 0){ lc(21, 16); log("$"); } if(coin5 == 0){ lc(0, 20); log("$"); } lc(x, y); log("K"); sleep(10); }