WXME0104 ## wxtextwxtabwxmediawximage$(lib "comment-snip.ss" "framework")+(lib "collapsed-snipclass.ss" "framework")drscheme:sexp-snipdrscheme:number,(lib "number-snip.ss" "drscheme" "private")"drscheme:vertical-separator-snip%wxbaddrscheme:xml-snip(lib "xml-snipclass.ss" "xml")drscheme:scheme-snip"(lib "scheme-snipclass.ss" "xml")wxloc-K ZZZZ€ÿ€ÿ€ÿ StandardK-adobe-courier ZZZZ€ÿ€ÿ€ÿF?ð\ZZZ?ð?ð?ð"€‹"Matching Parenthesis StyleF?ð\ZZZ?ð?ð?ð"€‹"F?ð\ZZZ?ð?ð?ð(drscheme:check-syntax:keywordF?ð\ZZZ?ð?ð?ð(F?ðZZZZ?ð?ð?ð€ÿ'drscheme:check-syntax:unbound-variableF?ðZZZZ?ð?ð?ð€ÿF?ðZZZZ?ð?ð?ð€€%drscheme:check-syntax:bound-variableF?ðZZZZ?ð?ð?ð€€ drscheme:check-syntax:primitiveF?ðZZZZ?ð?ð?ð€€F?ðZZZZ?ð?ð?ð3€‡'drscheme:check-syntax:constantF?ðZZZZ?ð?ð?ð3€‡'F?ðZZZZ?ð?ð?ð€¥**drscheme:check-syntax:baseF?ðZZZZ?ð?ð?ð€¥**F?ðZZZZ?ð?ð?ð?ð?ð?ðXMLF?ðZZZZ?ð?ð?ð?ð?ð?ðK ZZZZ€ÿ€ÿ€ÿK-adobe-courier ZZZZ€ÿ€ÿ€ÿF?ð\ZZZ?ð?ð?ð"€‹"F?ð\ZZZ?ð?ð?ð(F?ðZZZZ?ð?ð?ð€ÿF?ðZZZZ?ð?ð?ð€€F?ðZZZZ?ð?ð?ð3€‡'F?ðZZZZ?ð?ð?ð€¥**F?ðZZZZ?ð?ð?ð?ð?ð?ðG?ðZZZZ?ð?ð?ð?ð?ð?ðF?ðZZZZ?ð?ð?ð€ÿG?ðZZZZ?ð?ð?ð€ÿG?ðZZZZ?ð?ð?ðdF?ð\ZZZ€ÿ€ÿF?ðZZ^Z?ð?ð?ð€ÿF?ð\ZZZ?ð?ð?ð€¯F?ð\ZZZ?ð?ð?ð€–€–F?ðZZZZ?ð?ð?ð€ÈG?ðZZZZ?ð?ð?ð?ð?ð?ðF?ðZZZZ?ð?ð?ð€ÿG?ðZZZZ?ð?ð?ð€ÿG?ðZZZZ?ð?ð?ðdF?ð\ZZZ€ÿ€ÿF?ðZZ^Z?ð?ð?ð€ÿF?ð\ZZZ?ð?ð?ð€–€–F?ðZZZZ?ð?ð?ð€ÈF?ð\ZZZ?ð?ð?ð€¯€°å&Kirsten M. Plowman '04, P.O. Box 11-28 "David S. Wylie '06, P.O. Box 15-32 *CSC151-02, Spring 2003, Samuel A. Rebelsky  Homework 3: A Web-Based Mad Libs Friday, 7 March 2003 File name: madlibrandom.ss Available in MathLAN as  + /home/plowman/public_html/madlibrandom.ss Available on the Web as  7 http://www.cs.grinnell.edu/~plowman/madlibrandom.html  Help from:    (load '"/home/rebelsky/Web/Scheme/webutils.ss")  ;cite this as Sam's (define random-element  (lambda (lst)  (list-ref lst (random (length lst)))))   (define page  (lambda () J (madlib (random-element (list "red" "orange" "yellow" "green" "blue")) J (random-element (list "red" "orange" "yellow" "green" "blue")) J (random-element (list "red" "orange" "yellow" "green" "blue")) J (random-element (list "red" "orange" "yellow" "green" "blue")) J (random-element (list "red" "orange" "yellow" "green" "blue")) J (random-element (list "red" "orange" "yellow" "green" "blue")) J (random-element (list "red" "orange" "yellow" "green" "blue")) J (random-element (list "red" "orange" "yellow" "green" "blue")) M (random-element (list "red" "orange" "yellow" "green" "blue")))))  (define madlib  (lambda ( proper-noun-1  adjective-2 noun-3  adjective-4  participle-5 intransitive-verb-6 noun-7 noun-8  adjective-9)  ( make-page  (head ( string-append "The Story of "  proper-noun-1  " and the "   noun-3))  (body ( string-append  ( paragraph ( string-append "Two score and one day ago "  proper-noun-1 " was making "  adjective-2 " " noun-3 " in " noun-8  ".  The other "  adjective-4 3" children had come to watch when all of a sudden "  proper-noun-1 " lost control of the "  adjective-9 " " noun-3  "  and it went "  participle-5 " down " noun-8 D" hill. Little Joey Puticcini was the unfortunate victim when the " noun-3 " "  intransitive-verb-6  " the new " noun-7 " he had made.")))))))     ÛK (define a-an  (lambda (noun) ) (if (or (eq? (string-ref noun 0) #\a) ) (eq? (string-ref noun 0) #\e) ) (eq? (string-ref noun 0) #\i) ) (eq? (string-ref noun 0) #\o) ) (eq? (string-ref noun 0) #\u) ) (eq? (string-ref noun 0) #\y) ) (eq? (string-ref noun 0) #\A) ) (eq? (string-ref noun 0) #\E) ) (eq? (string-ref noun 0) #\I) ) (eq? (string-ref noun 0) #\O) ) (eq? (string-ref noun 0) #\U) * (eq? (string-ref noun 0) #\Y)) " (string-append "an " noun) $ (string-append "a " noun))))  (define checker M (lambda (intransitive-verb-6-1 intransitive-verb-6-2 intransitive-verb-6-3  ! intransitive-verb-6-4)  (string-append 6 (if (not (empty-string? intransitive-verb-6-1))  intransitive-verb-6-1  "")  6 (if (not (empty-string? intransitive-verb-6-2)) 9 (string-append ", and " intransitive-verb-6-2)  "") 6 (if (not (empty-string? intransitive-verb-6-3)) 9 (string-append ", and " intransitive-verb-6-3)  "") 6 (if (not (empty-string? intransitive-verb-6-4)) 9 (string-append ", and " intransitive-verb-6-4)  ""))))  (define empty-string?  (lambda (str) $ (= (string-length str) 0)))   " StandardF?ðZZZZ?ð?ð?ð?ð?ð?ðK ZZZZ€ÿ€ÿ€ÿK-adobe-courier ZZZZ€ÿ€ÿ€ÿF?ð\ZZZ?ð?ð?ð"€‹"Matching Parenthesis StyleF?ð\ZZZ?ð?ð?ð"€‹"F?ð\ZZZ?ð?ð?ð(drscheme:check-syntax:keywordF?ð\ZZZ?ð?ð?ð(F?ðZZZZ?ð?ð?ð€ÿ'drscheme:check-syntax:unbound-variableF?ðZZZZ?ð?ð?ð€ÿF?ðZZZZ?ð?ð?ð€€%drscheme:check-syntax:bound-variableF?ðZZZZ?ð?ð?ð€€ drscheme:check-syntax:primitiveF?ðZZZZ?ð?ð?ð€€F?ðZZZZ?ð?ð?ð3€‡'drscheme:check-syntax:constantF?ðZZZZ?ð?ð?ð3€‡'F?ðZZZZ?ð?ð?ð€¥**drscheme:check-syntax:baseF?ðZZZZ?ð?ð?ð€¥**F?ðZZZZ?ð?ð?ð?ð?ð?ðXMLF?ðZZZZ?ð?ð?ð?ð?ð?ðG?ðZZZZ?ð?ð?ð?ð?ð?ðF?ðZZZZ?ð?ð?ð€ÿG?ðZZZZ?ð?ð?ð€ÿG?ðZZZZ?ð?ð?ðdF?ð\ZZZ€ÿ€ÿF?ðZZ^Z?ð?ð?ð€ÿF?ð\ZZZ?ð?ð?ð€¯F?ð\ZZZ?ð?ð?ð€–€–F?ðZZZZ?ð?ð?ð€È$ !(get-cgi-variable 'proper-noun-1) Q (if (= (string-length (get-cgi-variable 'adjective-2 "hilarious")) 0) ; (get-cgi-variable 'adjective-2 "hilarious") C (a-an (get-cgi-variable 'adjective-2 "hilarious"))) . (get-cgi-variable 'noun-3 "brick") 7 (get-cgi-variable 'adjective-4 "monstrous") 8 (get-cgi-variable 'participle-5 "careening")  (checker  ,(get-cgi-variable 'intransitive-verb-6-1 "")  : (get-cgi-variable 'intransitive-verb-6-2 "") : (get-cgi-variable 'intransitive-verb-6-3 "") ; (get-cgi-variable 'intransitive-verb-6-4 "")) - (get-cgi-variable 'noun-7 "bike") M (if (= (string-length (get-cgi-variable 'noun-8 "schoolyard")) 0) E (get-cgi-variable 'noun-8 "schoolyard")  ? (a-an (get-cgi-variable 'noun-8 "schoolyard"))) < (get-cgi-variable 'adjective-9 "poor little"))))