uses graph,wincrt;
var
gd,gm,x,y,i,px,py:integer;
c:char;
begin
gd:=detect;
initgraph(gd,gm,'');
randomize;
x:=500; y:=500;
px:=10; py:=10;
while px and py <> x and y do begin
if px<x then px:=px+1;
if px>x then px:=px-1;
if py<y then py:=py+1;
if py>y then py:=py-1;
putpixel(px,py,green);
putpixel(x,y,red);
delay(20);
if keypressed then c:=readkey;
case c of
'w':y:=y-1;
'd':x:=x+1;
's':y:=y+1;
'a':x:=x-1;
end;
end;
readln;
end.
Сообщение отредактировано: suriv -