
===== 1 nest =====

(nest '0)
    ==> () CORRECT
(nest '1)
    ==> (()) CORRECT
(nest '3)
    ==> (((()))) CORRECT

===== 2 alternate =====

(alternate '())
    ==> !!! *** EXCEPTION: should be: ()
(alternate '(1))
    ==> (1) CORRECT
(alternate '(1 2))
    ==> !!! *** EXCEPTION: should be: (1)
(alternate '(1 2 3))
    ==> (1 3) CORRECT
(alternate '(1 2 3 4))
    ==> !!! *** EXCEPTION: should be: (1 3)
(alternate '(1 2 3 4 5))
    ==> (1 3 5) CORRECT
(alternate '(a (b c) (d (e f)) g (quote ()) 1 "two" 3 4))
    ==> (a (d (e f)) (quote ()) "two" 4) CORRECT

===== 3 all-same? =====

(all-same? '())
    ==> #t CORRECT
(all-same? '(1))
    ==> #t CORRECT
(all-same? '(1 1 1 1 1))
    ==> #t CORRECT
(all-same? '(1 1 1 2 1))
    ==> #f CORRECT
(all-same? '((a b) (a b) (a b)))
    ==> #t CORRECT
(all-same? '((a b) (a b) (a a)))
    ==> #f CORRECT

===== 4 remove-leading =====

(remove-leading 'x '())
    ==> () CORRECT
(remove-leading 'x '(a b c x y z))
    ==> (x y z) CORRECT
(remove-leading 'x '(a b c))
    ==> () CORRECT
(remove-leading '(p q) '(a (p q) b (p q) c))
    ==> ((p q) b (p q) c) CORRECT

===== 5 subst-first =====

(subst-first 'dog 'mouse '())
    ==> () CORRECT
(subst-first 'dog 'cat '(my cat is smart))
    ==> (my dog is smart) CORRECT
(subst-first 'dog 'mouse '(my cat is smart))
    ==> (my cat is smart) CORRECT
(subst-first 'x '(a (b (c))) '(a b ((a (b (c)))) d (a (b (c))) e (a (b (c)))))
    ==> (a b (x) d x e x) *** ERROR: should be: (a b ((a (b (c)))) d x e (a (b (c))))

===== 6 translate =====

(translate 'mouse '())
    ==> () CORRECT
(translate 'cat '((dog chien) (cat chat)))
    ==> chat CORRECT
(translate 'chair '((table desk) (chair stool) (lamp light)))
    ==> stool CORRECT
(translate 'maison '((maison house) (house maison) (mansion casa)))
    ==> house CORRECT

===== 7 sandwich-first =====

(sandwich-first 'meat 'bread '())
    ==> !!! *** EXCEPTION: should be: ()
(sandwich-first 'meat 'bread '(bread bread))
    ==> (bread meat bread) CORRECT
(sandwich-first 'meat 'bread '(bread))
    ==> #<void> *** ERROR: should be: (bread)
(sandwich-first 'meat 'bread '(bread cheese bread bread))
    ==> #<void> *** ERROR: should be: (bread cheese bread meat bread)
(sandwich-first 'meat 'bread '(bread cheese bread bread pickle bread bread))
    ==> #<void> *** ERROR: should be: (bread cheese bread meat bread pickle bread bread)
(sandwich-first 'meat 'bread '(bread cheese bread pickle bread))
    ==> #<void> *** ERROR: should be: (bread cheese bread pickle bread)

===== 8 count =====

(count 'x '())
    ==> 0 CORRECT
(count 'x '(a b x c x x d))
    ==> 3 CORRECT
(count 'x '(a b c d e f))
    ==> 0 CORRECT
(count '(p q) '(a (p q) (b ((p q) c)) d))
    ==> 2 CORRECT

===== 9 union =====

(union '() '())
    ==> () CORRECT
(union '(a b c) '())
    ==> (a b c) CORRECT
(union '() '(a b c))
    ==> (a b c) CORRECT
(union '(a b (c)) '(b (c) d))
    ==> (a b (c) d) CORRECT
(union '(a a a) '(a a a a a))
    ==> (a) CORRECT

===== 10 intersect =====

(intersect '() '())
    ==> () CORRECT
(intersect '(a b c) '())
    ==> () CORRECT
(intersect '() '(a b c))
    ==> () CORRECT
(intersect '(a b (c)) '(a (c) d))
    ==> (a (c)) CORRECT
(intersect '(a b b c) '(b c c d))
    ==> (b b c) *** ERROR: should be: (b c)
(intersect '(a b c) '((c) d e))
    ==> () CORRECT
(intersect '(a a a) '(a a a a a))
    ==> (a a a) *** ERROR: should be: (a)

=====================================
11 errors out of 50 tests. SCORE: 78
=====================================

