感谢上外静中任淳同学提供
uses crt;
var
x,y:byte;
c:char;
procedure move;
begin
clrscr;
gotoxy(x,y-1);
write('*');
gotoxy(x-1,y);
write('/|\');
gotoxy(x,y+1);
write('^');
end;
procedure still;
begin
clrscr;
gotoxy(x,y-1);
write('*');
gotoxy(x,y);
write('|');
gotoxy(x,y+1);
write('^');
end;
procedure a;
begin
x:=x-1;
if x=1 then x:=79;
move;
delay(100);
still;
end;
procedure d;
begin
x:=x+1;
if x=80 then x:=2;
move;
delay(100);
still;
end;
procedure w;
begin
y:=y-1;
if y=1 then y:=24;
move;
delay(100);
still;
end;
procedure s;
begin
y:=y+1;
if y=25 then y:=2;
move;
delay(100);
still;
end;
begin
x:=2;
y:=2;
still;
while true do begin
if keypressed then begin
c:=readkey;
if c='a' then a;
if c='s' then s;
if c='d' then d;
if c='w' then w;
end;
end;
end.