91
for j:=MaxJ-1 downto 1 do
NetArr[i+1,j]:=NetArr[i,j];
MaxI:=MaxI+1;
end;
procedure InsertHorLine(y:real;a:integer);
var i,j: integer;
begin
for j:=MaxJ downto a do
JNetArr[j+1]:=JNetArr[j];
JNetArr[a]:=y;
for i:=MaxI-1 downto 1 do
for j:=MaxJ-1 downto a-1 do
NetArr[i,j+1]:=NetArr[i,j];
MaxJ:=MaxJ+1;
end;
procedure InsertRect(x,y,lx,ly:real);
var
i,j,X1Index,X2Index,Y1Index,Y2Index: integer;
begin
i:=1;
while (x>INetArr[i]) do i:=i+1;
if x<>INetArr[i] then
InsertVerLine(x,i);
X1Index:=i;
while (x+lx>INetArr[i]) do i:=i+1;
if x+lx<>INetArr[i] then
InsertVerLine(x+lx,i);
X2Index:=i;
j:=1;
while (y>JNetArr[j]) do j:=j+1;
if y<>JNetArr[j] then
InsertHorLine(y,j);
Y1Index:=j;
while (y+ly>JNetArr[j]) do j:=j+1;
if y+ly<>JNetArr[j] then
InsertHorLine(y+ly,j);
Y2Index:=j;
for i:=X1Index to X2Index-1 do
for j:=Y1Index to Y2Index-1 do
NetArr[i,j]:=false;
end;
begin (* Main Program *)
{ initialization }
write(“Enter test N:”); readln(num);
Str(num,numstr);
assign(f1,’1test’+numstr+’.txt’);
reset(f1,1);
assign(f2,’mytemp.tmp’);
rewrite(f2,1);