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,26 @@
get "libhdr"
let insertionSort(A, len) be
for i = 1 to len-1 do
$( let value = A!i
let j = i-1
while j >= 0 & A!j > value do
$( A!(j+1) := A!j
j := j-1
$)
A!(j+1) := value
$)
let write(s, A, len) be
$( writes(s)
for i=0 to len-1 do writed(A!i, 4)
wrch('*N')
$)
let start() be
$( let array = table 4,65,2,-31,0,99,2,83,782,1
let length = 10
write("Before: ", array, length)
insertionSort(array, length)
write("After: ", array, length)
$)