mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
7 lines
248 B
QBasic
7 lines
248 B
QBasic
10 DEFUN LESSER(P,X)=X<P
|
|
11 DEFUN GTEQ(P,X)=X>=P
|
|
12 DEFUN QSORT(XS)=IF LEN(XS)<1 THEN NIL ELSE QSORT(FILTER(CURRY(LESSER,XS(0)),XS)) # XS(0)!NIL # QSORT(FILTER(CURRY(GTEQ,XS(0)),XS))
|
|
100 L=7!9!4!5!2!3!1!8!6!NIL
|
|
110 SL=QSORT(L)
|
|
120 PRINT L:PRINT SL
|