Data update
This commit is contained in:
parent
5af6d93694
commit
796d366b97
455 changed files with 7413 additions and 1900 deletions
13
Task/Combinations/Acornsoft-Lisp/combinations.lisp
Normal file
13
Task/Combinations/Acornsoft-Lisp/combinations.lisp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(defun comb (m n (i . 0))
|
||||
(cond ((zerop m) '(()))
|
||||
((eq i n) '())
|
||||
(t (append
|
||||
(mapc '(lambda (rest) (cons i rest))
|
||||
(comb (sub1 m) n (add1 i)))
|
||||
(comb m n (add1 i))))))
|
||||
|
||||
(defun append (a b)
|
||||
(cond ((null a) b)
|
||||
(t (cons (car a) (append (cdr a) b)))))
|
||||
|
||||
(map print (comb 3 5))
|
||||
Loading…
Add table
Add a link
Reference in a new issue