Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define FIBO
- (fib 15))
- (define inlist
- (lambda (nr list)
- (if (null? list)
- #f
- (if (= nr (car list))
- #t
- (inlist nr (cdr list))))))
- (define extract
- (lambda (list)
- (if (null? list)
- '()
- (if (inlist (- (length list) 1) FIBO)
- (cons (car (reverse list)) (extract (cdr (reverse list))))
- (extract (cdr (reverse list)))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement