;; CPSC 110 - Search Lab
;; Clown is String
;; interp. The name of a clown
(define M "Marny")
(define N "Nifty")
(define O "Oscar")
(define P "Porky")
(define R "Rascal")
(define S "Sunny")
(define V "Vinny")
#
...
;; CPSC 110 - Search Lab
;; Clown is String
;; interp. The name of a clown
(define M "Marny")
(define N "Nifty")
(define O "Oscar")
(define P "Porky")
(define R "Rascal")
(define S "Sunny")
(define V "Vinny")
#;
(define (fn-for-clown c)
(... c))
; PRELAB: Define examples of ChoiceState that correspond to the two scenarios
; (on the lab page)
(define-struct chst (picked options))
;; ChoiceState is (make-chst (listof Clown) (listof Clown))
;; interp. (make-chst picked options) represents a moment during selection when:
;; - we have selected all of the clowns in picked
;; - we are still deciding whether to pick or skip the clowns in options
;; INVARIANT: all of the clowns in picks and options are unique.
(define CH0 (make-chst (list) (list M N O P R S V))) ; no selections yet
(define CH1 (make-chst (list M) (list O P R S V))) ; M picked, N skipped
(define CH2 (make-chst (list M P V) (list))) ; picking is complete
(define CH3 (make-chst empty (list V R O))) ;;Prelab 1
(define CH4 (make-chst (list R V) (list O))) ;;Prelab 1
(define CHs (make-chst (list S R P O M) empty)) ;; one of the solutions
#;
(define (fn-for-chst c)
(... (fn-for-loc (chst-picked c))
(fn-for-loc (chst-options c))))
;; ========================================================
;; Functions
; PRELAB: Our main task in lab will be to design a function, called solve,
; that takes a choice state and tries to find a list of clowns that satisfy
; the criteria based from our choice state. Start the design of solve by writing
; its wish list entry.
;
; You should also identify which template elements you will need to blend
; together for the solve function.
[Show More]