Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,20 @@
code Ran=1, ChOut=8, IntOut=11;
proc BogoSort(A, L); \Sort array A of length L
int A, L;
int I, J, T;
[loop [I:= 0;
loop [if A(I) > A(I+1) then quit;
I:= I+1;
if I >= L-1 then return;
];
I:= Ran(L); J:= Ran(L);
T:= A(I); A(I):= A(J); A(J):= T;
];
];
int A, I;
[A:= [3, 1, 4, 1, -5, 9, 2, 6, 5, 4];
BogoSort(A, 10);
for I:= 0 to 10-1 do [IntOut(0, A(I)); ChOut(0, ^ )];
]