PascaL ( KovaLamaca Oyunu Programı )
Uses crt;
Var
fr,scor,o,z,ux,uy,x,y:Integer;
ch,tus:Char;
a:Boolean;
az:array[1..5] of boolean;
Procedure yon(ch:char);
Begin
fr:=0;
case ch of
#77:If x<80 then inc(x);
#80:If y<25 then inc(y);
#75:if x>1 then dec(x);
#72:If y>1 then dec(y);
end;
gotoxy(40,13);write('Sizin koordinantlariniz:',x,' ',y);
gotoxy(40,14);write('Ulduzun koordinantlari :',ux,' ',uy);
gotoxy(40,15);write('Scor :',scor);
gotoxy(x,y);
inc(fr);
End;
Begin
clrscr;
gotoxy(15,15);write('*');o:=0;scor:=0;
x:=1;y:=1;ux:=15;uy:=15;
gotoxy(x,y);
randomize;
Repeat
tus:=readkey;
clrscr;
gotoxy(x,y);write(#1);
If tus=#0 then tus:=readkey;
yon(tus);
If (x=ux) and (y=uy) then begin inc(o);scor:=scor+100;az[o]:=true; end;
If o=3 then break;
z:=random(5);
delay(200);
case z of
1:inc(uy);
2:dec(uy);
3:inc(ux);
4:dec(ux);
end;
gotoxy(ux,uy);
write('*');If fr=100 then a:=false;
Until tus=#27;
If (az[1]=true) and (az[2]=true) and (az[3]=true) then begin clrscr;write('S I Z U D D U N U Z ! ! !');readln; end;
If a=false then begin clrscr;write('S I Z U D U Z D U N U Z ! ! !');end;
end.