all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,21 @@
DIM test(9)
test() = 4, 65, 2, -31, 0, 99, 2, 83, 782, 1
PROCinsertionsort(test(), 10)
FOR i% = 0 TO 9
PRINT test(i%) ;
NEXT
PRINT
END
DEF PROCinsertionsort(a(), n%)
LOCAL i%, j%, t
FOR i% = 1 TO n%-1
t = a(i%)
j% = i%
WHILE j%>0 AND t<a(ABS(j%-1))
a(j%) = a(j%-1)
j% -= 1
ENDWHILE
a(j%) = t
NEXT
ENDPROC