なんかハイライト間違ってね?しかもなんだか行間がめちゃめちゃ開くのはなんで?
(define combination (lambda (r l) (cond ((null? l) '()) ((or (zero? r)(> r (length l))) '()) ((= r 1)(map list l)) ((= r (length l))(list l)) (else (append (map (lambda (n)(cons (car l) n)) (combination (- r 1)(cdr l))) (combination r (cdr l))))))) |
(define combination (lambda (r l) (cond ((null? l) '()) ((or (zero? r)(> r (length l))) '()) ((= r 1)(map list l)) ((= r (length l))(list l)) (else (append (map (lambda (n)(cons (car l) n)) (combination (- r 1)(cdr l))) (combination r (cdr l))))))) |
0 件のコメント:
コメントを投稿