program Serpiente;
uses crt;
var
a, b, i: integer;
k: char;
begin
clrscr;
a:= 20;
b:= 20;
gotoxy (a,b);writeln ('O');
k:=readkey;
repeat
delay(8000);
gotoxy (a,b); writeln (' ');
if k='a' then
begin
a:=a-1;
end;
if k='s' then
begin
b:=b+1;
end;
if k='d' then
begin
a:=a+1;
end;
if k='w' then
begin
b:=b-1;
end;
gotoxy (a,b); writeln ('O');
until keypressed
end.