3 (require "amb-eli.rkt")
4 (require "distinct.rkt")
6 (define (multiple-dwelling)
7 (let ([baker (amb 1 2 3 4 5)]
8 [cooper (amb 1 2 3 4 5)]
9 [fletcher (amb 1 2 3 4 5)]
10 [miller (amb 1 2 3 4 5)]
11 [smith (amb 1 2 3 4 5)])
12 (assert (distinct? (list baker cooper fletcher miller smith)))
13 (assert (not (= baker 5)))
14 (assert (not (= cooper 1)))
15 (assert (not (= fletcher 5)))
16 (assert (not (= fletcher 1)))
17 (assert (> miller cooper))
18 ;; (assert (not (= (abs (- smith fletcher)) 1)))
19 (assert (not (= (abs (- fletcher cooper)) 1)))
20 (list (list 'baker baker)
22 (list 'fletcher fletcher)
24 (list 'smith smith))))
26 (collect (multiple-dwelling))
29 '(((baker 1) (cooper 2) (fletcher 4) (miller 3) (smith 5))
30 ((baker 1) (cooper 2) (fletcher 4) (miller 5) (smith 3))
31 ((baker 1) (cooper 4) (fletcher 2) (miller 5) (smith 3))
32 ((baker 3) (cooper 2) (fletcher 4) (miller 5) (smith 1))
33 ((baker 3) (cooper 4) (fletcher 2) (miller 5) (smith 1)))