代码拉取完成,页面将自动刷新
(let ()
(define Substance
'((1 2 3 4 5 6 7 8)
()
()))
(define move
(lambda (from to)
(set! Substance
(let ((x (car (from Substance))))
(cond ((and (eq? from car) (eq? to cadr))
`(,(cdr (from Substance)) ,(cons x (to Substance)) ,(caddr Substance)))
((and (eq? from car) (eq? to caddr))
`(,(cdr (from Substance)) ,(cadr Substance) ,(cons x (to Substance))))
((and (eq? from cadr) (eq? to car))
`(,(cons x (to Substance)) ,(cdr (from Substance)) ,(caddr Substance)))
((and (eq? from cadr) (eq? to caddr))
`(,(car Substance) ,(cdr (from Substance)) ,(cons x (to Substance))))
((and (eq? from caddr) (eq? to car))
`(,(cons x (to Substance)) ,(cadr Substance) ,(cdr (from Substance))))
((and (eq? from caddr) (eq? to cadr))
`(,(car Substance) ,(cons x (to Substance)) ,(cdr (from Substance)))))))
(display Substance)
(newline)))
(define (H n start temp end)
(if (= n 1)
(move start end)
(begin (H (- n 1) start end temp)
(H 1 start temp end)
(H (- n 1) temp start end))))
(H (length (car Substance)) car cadr caddr))
这里使用了宏。。。jsp还不支持宏……
那太遗憾了
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论