ответ:
uses crt;
var
x,y,vx,vy: integer;
ch: char;
begin
clrscr;
x : = 1;
y : = 25 div 2;
while (x> =1) and (x< =80) and (y> =1) and (y< =25) do begin
gotoxy(x,y);
write('0');
delay(60);
if keypressed then begin
ch : = readkey;
case ch of
'd': begin vx: =1; vy: =0 end;
'a': begin vx: =-1; vy: =0 end;
'w': begin vx: =0; vy: =-1 end;
's': begin vx: =0; vy: =1 end;
end;
write(' ');
inc(x,vx);
inc(y,vy);
end.
ответ:
uses crt;
var
x,y,vx,vy: integer;
ch: char;
begin
clrscr;
x : = 1;
y : = 25 div 2;
while (x> =1) and (x< =80) and (y> =1) and (y< =25) do begin
gotoxy(x,y);
write('0');
delay(60);
if keypressed then begin
ch : = readkey;
case ch of
'd': begin vx: =1; vy: =0 end;
'a': begin vx: =-1; vy: =0 end;
'w': begin vx: =0; vy: =-1 end;
's': begin vx: =0; vy: =1 end;
end;
end;
gotoxy(x,y);
write(' ');
inc(x,vx);
inc(y,vy);
end;
end.