Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -9,12 +9,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,34 +23,34 @@ var Mat: TMatrix;
|
|||
var X,Y,Inx,Dir: integer;
|
||||
const Size = 10;
|
||||
|
||||
procedure Toggle(var I: integer);
|
||||
{Toggle Direction and increment I}
|
||||
begin
|
||||
Dir:=-Dir;
|
||||
Inc(I);
|
||||
end;
|
||||
procedure Toggle(var I: integer);
|
||||
{Toggle Direction and increment I}
|
||||
begin
|
||||
Dir:=-Dir;
|
||||
Inc(I);
|
||||
end;
|
||||
|
||||
|
||||
procedure Step(var X,Y: integer);
|
||||
{Take one step "Dir" direction}
|
||||
begin
|
||||
X:=X+Dir;
|
||||
Y:=Y-Dir;
|
||||
end;
|
||||
procedure Step(var X,Y: integer);
|
||||
{Take one step "Dir" direction}
|
||||
begin
|
||||
X:=X+Dir;
|
||||
Y:=Y-Dir;
|
||||
end;
|
||||
|
||||
begin
|
||||
SetLength(Mat,Size,Size);
|
||||
Inx:=0; X:=0; Y:=0; Dir:=1;
|
||||
repeat
|
||||
begin
|
||||
Mat[X,Y]:=Inx;
|
||||
if (X+Dir)>=Size then Toggle(Y)
|
||||
else if (Y-Dir)>=Size then Toggle(X)
|
||||
else if (X+Dir)<0 then Toggle(Y)
|
||||
else if (Y-Dir)<0 then Toggle(X)
|
||||
else Step(X,Y);
|
||||
Inc(Inx);
|
||||
end
|
||||
begin
|
||||
Mat[X,Y]:=Inx;
|
||||
if (X+Dir)>=Size then Toggle(Y)
|
||||
else if (Y-Dir)>=Size then Toggle(X)
|
||||
else if (X+Dir)<0 then Toggle(Y)
|
||||
else if (Y-Dir)<0 then Toggle(X)
|
||||
else Step(X,Y);
|
||||
Inc(Inx);
|
||||
end
|
||||
until Inx>=Size*Size;
|
||||
DisplayMatrix(Memo,Mat);
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue