Solutions to the room draw problem Part (a): (make-request 'Beavis 'Butthead (lambda (mor dan) (cond [(> dan 2) 'daniels] [else 'morgan]))) Part (b) -- two versions of the solution ;; draw-rooms : number number list[request] -> list[asgmt] ;; creates dorm assignments based on requests (define (draw-rooms mor dan alor) (cond [(empty? alor) empty] [(cons? alor) (local [(define choice ((request-choose (first alor)) mor dan))] (cond [(symbol=? choice 'daniels) (cons (make-asgmt (request-student1 (first alor)) (request-student2 (first alor)) 'daniels) (draw-rooms mor (- dan 1) (rest alor)))] [else (cons (make-asgmt (request-student1 (first alor)) (request-student2 (first alor)) 'morgan) (draw-rooms (- mor 1) dan (rest alor)))]))])) ;; draw-rooms : number number list[request] -> list[asgmt] ;; creates dorm assignments based on requests (define (draw-rooms mor dan alor) (cond [(empty? alor) empty] [(cons? alor) (local [(define choice ((request-choose (first alor)) mor dan)) (define asgmt (make-asgmt (request-student1 (first alor)) (request-student2 (first alor)) choice))] (cond [(symbol=? choice 'daniels) (cons asgmt (draw-rooms mor (- dan 1) (rest alor)))] [else (cons asgmt (draw-rooms (- mor 1) dan (rest alor)))]))]))