Procedure oyun;
Label
tekrar_gir;
var
x,y:Byte;
satir,sutun:Byte;
a,ts:Byte;
Begin
randomize;
x:=random(78)+2;
y:=random(19)+2;
ts:=0;
tekrar gir:
clrscr;
for a:=1 to 80 do Begin
gotoxy(a,1);Write('.');
gotoxy(a,21);Write('.');
End;
for a:=1 to 21 do Begin
gotoxy(1,a);Write('.');
gotoxy(80,a);Write('.');
End;
gotoxy(1,23);Write('Tahmininizi Giriniz:');
gotoxy(30,23);Write('Sutun No...:');
gotoxy(50,23);Write('Satr No...:');
gotoxy(x,y);Write('*');
gotoxy(43,23);Readln(sutun);
gotoxy(63,23);Readln(satir);
If (not(satir in[2..20])) or
(not(sutun in [2..79])) then
goto tekrar_gir;
ts:=ts+1;
If (Satir=y) and (Sutun=x)
then begin
gotoxy(30,12);Write('Aferin Bildiniz');
Gotoxy(30,13);Write('Tahmin Saynz:',ts);
End else Begin
gotoxy(sutun,satir);Write('X');delay(1000);
gotoxy(sutun,satir);write('');
goto tekrar_gir;
End;
Readln;
End.