Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -8,12 +8,12 @@ var S: string;
|
|||
begin
|
||||
S:='';
|
||||
for Y:=0 to High(Mat[0]) do
|
||||
begin
|
||||
S:=S+'[';
|
||||
for X:=0 to High(Mat) do
|
||||
S:=S+Format('%4.0f',[Mat[X,Y]]);
|
||||
S:=S+']'+#$0D#$0A;
|
||||
end;
|
||||
begin
|
||||
S:=S+'[';
|
||||
for X:=0 to High(Mat) do
|
||||
S:=S+Format('%4.0f',[Mat[X,Y]]);
|
||||
S:=S+']'+#$0D#$0A;
|
||||
end;
|
||||
Memo.Lines.Add(S);
|
||||
end;
|
||||
|
||||
|
|
@ -23,35 +23,35 @@ procedure MakeSpiralMatrix(var Mat: TMatrix; SizeX,SizeY: integer);
|
|||
var Inx: integer;
|
||||
var R: TRect;
|
||||
|
||||
procedure DoRect(R: TRect; var Inx: integer);
|
||||
{Create on turn of the spiral base on the rectangle}
|
||||
var X,Y: integer;
|
||||
begin
|
||||
{Do top part of rectangle}
|
||||
for X:=R.Left to R.Right do
|
||||
begin
|
||||
Mat[X,R.Top]:=Inx;
|
||||
Inc(Inx);
|
||||
end;
|
||||
{Do Right part of rectangle}
|
||||
for Y:=R.Top+1 to R.Bottom do
|
||||
begin
|
||||
Mat[R.Right,Y]:=Inx;
|
||||
Inc(Inx);
|
||||
end;
|
||||
{Do bottom part of rectangle}
|
||||
for X:= R.Right-1 downto R.Left do
|
||||
begin
|
||||
Mat[X,R.Bottom]:=Inx;
|
||||
Inc(Inx);
|
||||
end;
|
||||
{Do left part of rectangle}
|
||||
for Y:=R.Bottom-1 downto R.Top+1 do
|
||||
begin
|
||||
Mat[R.Left,Y]:=Inx;
|
||||
Inc(Inx);
|
||||
end;
|
||||
end;
|
||||
procedure DoRect(R: TRect; var Inx: integer);
|
||||
{Create on turn of the spiral base on the rectangle}
|
||||
var X,Y: integer;
|
||||
begin
|
||||
{Do top part of rectangle}
|
||||
for X:=R.Left to R.Right do
|
||||
begin
|
||||
Mat[X,R.Top]:=Inx;
|
||||
Inc(Inx);
|
||||
end;
|
||||
{Do Right part of rectangle}
|
||||
for Y:=R.Top+1 to R.Bottom do
|
||||
begin
|
||||
Mat[R.Right,Y]:=Inx;
|
||||
Inc(Inx);
|
||||
end;
|
||||
{Do bottom part of rectangle}
|
||||
for X:= R.Right-1 downto R.Left do
|
||||
begin
|
||||
Mat[X,R.Bottom]:=Inx;
|
||||
Inc(Inx);
|
||||
end;
|
||||
{Do left part of rectangle}
|
||||
for Y:=R.Bottom-1 downto R.Top+1 do
|
||||
begin
|
||||
Mat[R.Left,Y]:=Inx;
|
||||
Inc(Inx);
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
{Set matrix size}
|
||||
|
|
@ -61,10 +61,10 @@ R:=Rect(0,0,SizeX-1,SizeY-1);
|
|||
Inx:=0;
|
||||
{draw and deflate rectangle until spiral is done}
|
||||
while (R.Left<=R.Right) and (R.Top<=R.Bottom) do
|
||||
begin
|
||||
DoRect(R,Inx);
|
||||
InflateRect(R,-1,-1);
|
||||
end;
|
||||
begin
|
||||
DoRect(R,Inx);
|
||||
InflateRect(R,-1,-1);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue