|
program prova;
uses crt;
var a,b,cont:integer;
tasto:char;
begin
a:=1;
b:=1;
repeat
cont:=cont+1;
tasto:=readkey;
if tasto=char(0)
then tasto:=readkey;
if tasto=char(77)
then
begin
a:=a+1;
gotoxy(a,b);
end;
if tasto=char(75)
then
begin
a:=a-1;
gotoxy(a,b);
end;
if tasto=char(72)
then
begin
b:=b-1;
gotoxy(a,b);
end;
if tasto=char(80)
then
begin
b:=b+1;
gotoxy(a,b);
end;
until cont=-1;
readln;
end.
|
|