Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,29 @@
int A, Len;
func IsSorted;
int I;
[for I:= 0 to Len-2 do
if A(I) > A(I+1) then return false;
return true;
];
func PermSort(Last);
int Last;
int I, T;
[if Last <= 0 then return IsSorted;
for I:= 0 to Last do
[T:= A(I); A(I):= A(Last); A(Last):= T;
if PermSort(Last-1) then return true;
T:= A(I); A(I):= A(Last); A(Last):= T;
];
return false;
];
int I;
[A:= [170, 45, 75, -90, -802, 24, 2, 66];
Len:= 8;
PermSort(Len-1);
for I:= 0 to Len-1 do
[IntOut(0, A(I)); if I < Len-1 then Text(0, ", ")];
CrLf(0);
]