Kód: Vybrať všetko
uses crt;
var x,y:integer;
z,zb:char;
begin
x:=40;
y:=25;
clrscr;
gotoxy(x,y);
repeat
delay(200);
zb:=z;
if keypressed=true then
begin
z:=readkey;
if ((z='2')and(zb='8'))or((z='8') and (zb='2'))or((z='4') and
(zb='6'))or((z='6') and (zb='4')) then z:=zb;
end;
Case z of
'4':x:=x-1;
'8':y:=y-1;
'2':y:=y+1;
'6':x:=x+1;
end;
if (x<1)or(x>80) or (y>49)or(y<1) then z:=#27;
gotoxy(x,y);
write('*');
until z=#27;
clrscr;
gotoxy(33,25);
writeln('Game Over!');
readkey;
end.