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,17 @@
procedure main() #: demonstrate various ways to sort a list and string
demosort(selectionsort,[3, 14, 1, 5, 9, 2, 6, 3],"qwerty")
end
procedure selectionsort(X,op) #: return sorted list ascending(or descending)
local i,m
op := sortop(op,X) # select how and what we sort
every i := 1 to *X-1 do {
m := i
every j := i + 1 to *X do
if op(X[j],X[m]) then m := j # find X that belongs @i low (or high)
X[m ~= i] :=: X[m]
}
return X
end