- ;; (tt lst表 n1中间最大元素数量)
- (defun tt (lst n1 / i lst1 j k d)
- (defun abc (x n / b) (repeat n (setq b (cons x b))) b)
- (setq lst1 '()
- j 0
- )
- (foreach a lst
- (setq i 0)
- (repeat (1+ n1)
- (setq k 0)
- (foreach b lst
- (if (<= k j)
- (setq d (append (list a) (abc b i) (list a))
- lst1 (if (not (member d lst1))
- (cons d lst1)
- lst1
- )
- )
- )
- (setq k (1+ k))
- )
- (setq i (1+ i))
- )
- (setq j (1+ j))
- )
- (reverse lst1)
- )
- ;; (tt '("a" "b" "c" "d" "e") 3)
- ;; '(("a" "a") ("a" "a" "a") ("a" "a" "a" "a") ("a" "a" "a" "a" "a") ("b" "b") ("b" "a" "b") ("b" "b" "b") ("b" "a" "a" "b") ("b" "b" "b" "b") ("b" "a" "a" "a" "b") ("b" "b" "b" "b" "b") ("c" "c") ("c" "a" "c") ("c" "b" "c") ("c" "c" "c") ("c" "a" "a" "c") ("c" "b" "b" "c") ("c" "c" "c" "c") ("c" "a" "a" "a" "c") ("c" "b" "b" "b" "c") ("c" "c" "c" "c" "c") ("d" "d") ("d" "a" "d") ("d" "b" "d") ("d" "c" "d") ("d" "d" "d") ("d" "a" "a" "d") ("d" "b" "b" "d") ("d" "c" "c" "d") ("d" "d" "d" "d") ("d" "a" "a" "a" "d") ("d" "b" "b" "b" "d") ("d" "c" "c" "c" "d") ("d" "d" "d" "d" "d") ("e" "e") ("e" "a" "e") ("e" "b" "e") ("e" "c" "e") ("e" "d" "e") ("e" "e" "e") ("e" "a" "a" "e") ("e" "b" "b" "e") ("e" "c" "c" "e") ("e" "d" "d" "e") ("e" "e" "e" "e") ("e" "a" "a" "a" "e") ("e" "b" "b" "b" "e") ("e" "c" "c" "c" "e") ("e" "d" "d" "d" "e") ("e" "e" "e" "e" "e"))
|