Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (fooBar l1 l2)
- (define (foo1 x y lst1 list2)
- (cond
- ((and (null? list1) (null? list2)) null)
- ((null? list1) (foo2 y y list1 list2))
- ((= x 0) (cons (car list1) (foo2 (+ y 1) (+ y 1) (cdr list1) list2)))
- (else (cons (car list1) (foo1 (- x 1) y (cdr list1) list2))))))
- (define (foo2 x y list1 list2)
- (cond
- ((and (null? list1) (null? list2)) null)
- ((null? list2) (foo1 y y list1 list2))
- ((= x 0) (cons (car list2) (foo1 (+ y 1) (+ y 1) list1 (cdr list2))))
- (else (cons (car list2) (foo2 (- x 1) y list1 (cdr list2))))))
- (foo1 0 0 l1 l2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement