📄 differensort.scm
字号:
(define ls (list 3 1 2 4 5))
(define (sort lis)
(let ((i 0) (newls (list)) (j 1) (maxv 0) (templist (list)) (templ ls))
(let loop ((templ ls))
(let ((len (- (length templ) 1)))
(if (= (length templ) 1) (begin
(set! newls (append newls (list (list-ref templ 0))))
(display newls)
)
(begin
(if (> j len) (begin
(set! newls (append newls (list (list-ref templ maxv))))`
(set! maxv 0)
(set! j 1)
(set! i 0)
(set! templ templist)
(set! templist (list))
(loop templ)
)
(begin
(if (> (list-ref templ i) (list-ref templ j))
(begin
(set! templist (append templist (list (list-ref templ j))))
(set! maxv i)
(set! j (+ j 1))
(loop templ)
)
(begin
(set! templist (append templist (list (list-ref templ i))))
(set! maxv j)
(set! i j)
(set! j (+ j 1))
(loop templ))
)
)
)
)
)
)
)) )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -