Computer Science > Lab Report > University of British Columbia - CPSC 110CPSC 110 lab-search. (All)

University of British Columbia - CPSC 110CPSC 110 lab-search.

Document Content and Description Below

;; 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]

Last updated: 2 years ago

Preview 1 out of 9 pages

Buy Now

Instant download

We Accept:

We Accept
document-preview

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

We Accept

Reviews( 0 )

$7.00

Buy Now

We Accept:

We Accept

Instant download

Can't find what you want? Try our AI powered Search

210
0

Document information


Connected school, study & course


About the document


Uploaded On

Mar 22, 2021

Number of pages

9

Written in

Seller


seller-icon
Expert Tutor

Member since 4 years

58 Documents Sold

Reviews Received
6
2
0
0
3
Additional information

This document has been written for:

Uploaded

Mar 22, 2021

Downloads

 0

Views

 210

Document Keyword Tags


$7.00
What is Scholarfriends

In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·