;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-intermediate-reader.ss" "lang")((modname |LAB 6|) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f))) (require 2htdp/image)
(define-struct sentence (name subs)) ;; Sentence is (make-sentence String ListOfSentence) ;; interp. a sentence representing a single part of the tree with ;; name the sentence itself ;; subs the list of sub-sentences within the sentence
is ar stu ed d vi y re aC s o ou urc rs e eH w er as o. co m
;; ListOfSentences is one of: ;; - empty ;; - (cons Sentence ListOfSentence) ;; interp. a list of sentences
(define joking (make-sentence "joking about jealousy" empty)) (define you (make-sentence "you really mean it" empty)) (define in (make-sentence "in a book to school special about mono" empty)) (define perched (make-sentence "perched on the tip of a sinking boat" empty)) (define freez (make-sentence "freeze time" empty)) (define my (make-sentence "my favourite song on repeat" empty)) (define it (make-sentence "it is your last chance" empty)) (define we-are (make-sentence "we are" (list in perched))) (define like (make-sentence "like" (list it you we-are))) (define to (make-sentence "to" (list freez my))) (define kiss-me (make-sentence "kiss me" (list joking like to)))
Th
#;#; (define (fn-for-sentence s) (... (sentence-name s) (fn-for-los (sentence-subs s))))
sh
(define (fn-for-los los) (cond [(empty? los) (...)] [else (... (fn-for-sentence (first los)) (fn-for-los (rest los)))]))
This study source was downloaded by 100000805705997 from CourseHero.com on 10-14-2021 21:04:54 GMT -05:00
https://www.coursehero.com/file/21394492/LAB-6rkt/