WXME0106 ## wxtextwxtabwxmediawximage$(lib "comment-snip.ss" "framework")+(lib "collapsed-snipclass.ss" "framework")drscheme:sexp-snipdrscheme:syntax-snipclass%drscheme:number,(lib "number-snip.ss" "drscheme" "private")drscheme:bindings-snipclass%$(lib "cache-image-snip.ss" "mrlib")drscheme:lambda-snip%drscheme:define-snip%java-comment-box%java-interactions-box%&(lib "pict-snipclass.ss" "slideshow")"drscheme:vertical-separator-snip%wxbaddrscheme:xml-snip(lib "xml-snipclass.ss" "xml")drscheme:scheme-snip"(lib "scheme-snipclass.ss" "xml")test-case-box% text-box% HTML BulletwxlocMK ZZ StandardK Courier New ZZ?\???""Matching Parenthesis Style?\???""????&&(framework:syntax-coloring:scheme:symbol????&&)framework:syntax-coloring:scheme:keyword????&&????t)framework:syntax-coloring:scheme:comment????t????)&(framework:syntax-coloring:scheme:string????)&*framework:syntax-coloring:scheme:constant????)&????<$-framework:syntax-coloring:scheme:parenthesis????<$????'framework:syntax-coloring:scheme:error????@????'framework:syntax-coloring:scheme:other????????Qp1drscheme:check-syntax:lexically-bound-identifier????Qp????D*drscheme:check-syntax:imported-identifier????D%profj:syntax-coloring:scheme:keyword????????""$profj:syntax-coloring:scheme:string????""%profj:syntax-coloring:scheme:literal????""%profj:syntax-coloring:scheme:comment????t????@#profj:syntax-coloring:scheme:error????@(profj:syntax-coloring:scheme:identifier????&&%profj:syntax-coloring:scheme:default????F???????XMLF???????G???????????G????G????dF@\??????F?\??????F?\???F???????F????F?\???22F?]??????F???????F????F?\???F????K????K?\???F?33@\??????K???????K Courier New ZZ?\?????^???????????????????""????""????""? ?????""????"" ???? ????"" ?????????""??"" ; ;  A  C o l o r  i s  a  ( m a k e - c o l o r  r e d  g r e e n  b l u e )? ; ;  w h e r e  r e d ,  g r e e n ,  a n d  b l u e  a r e  N u m b e r s? ? ; ;  E x a m p l e s? (define? RED? (make-color? 2 5 5? 0? 0))? (define? GREEN? (make-color? 0? 2 5 5? 0))? (define? BLUE? (make-color? 0? 0? 2 5 5))? (define? MID? (make-color? 8 5? 8 5? 8 5))? ? #| TE MP LAT  E for color  ( d e f i n e  ( f  c )    . . .  ( color- r e d    c) . . .   . . .  (  color-gree n  c) . . .    . . .  (color-b l u e  c)  ... )  |#? ? ? ? ? ; ;  A  L i s t O f C o l o r i s  e i t h e r? ; ;  - -  e m p t y? ; ;  ( c o n s  C o l o r  L i s t O f C o l o r)? ? #| TE MP LAT E for L i s t O f C o l o r  ( d e f i n e  ( c  l o c )   ( c o n s   [( e m p t y ?  l o c )  . . . ]   [( c o n s ?  l o s )  . . .  ( f i r s t  l o c )  . . .  ( f  ( rest  loc ))  ... ]))  |#K K ; ;  E x a m p l e sK emptyK (consK REDK empty)K (consK BLUEK (consK REDK empty))? ? ? K K ; ;  C o l o r  - >  N u m b e rK ; ;  F i n d  t h e  a v e r a g e  v a l u e  o f  t h e  c o l o r  p o r t i o n sK (defineK ( color-avgK c)K K (roundK (/K (+K (color-redK c)K K ( color-greenK c)K K (color-blueK c))K 3)))? ? ; ;  T e s t sK (equal?? ( color-avg? RED)? ? 85)? (equal?? ( color-avg? GREEN)? 85)? (equal?? ( color-avg? BLUE)? 85)? (equal?? ( color-avg? MID)? 85)? K K ; ;  C o l o r  - >  C o l o rK ; ;  C o n v e r t  c  t o  a  b l a c k  a n d  w h i t e  c o l o rK (defineK (color->bwK c)K K (make-colorK ( color-avgK c)K ( color-avgK c)K ( color-avgK c)))? ? ; ;  T e s t s? (equal?? ( color->bw? RED)? ? MID)? (equal?? (color->bw? GREEN)? MID)? (equal?? (color->bw? BLUE)? MID)? (equal?? (color->bw? MID)? MID)? ? K K ; ;  C o l o r L i s t  - >  C o l o r L i s tK ; ;  C o n v e r t  a l l  c o l o r  t o  B W  c o l o r sK (defineK (all-bwK loc)K K (condK K [(empty?K loc)K empty]K K [(cons?K loc)K (consK (color->bwK (firstK loc))K K (all-bwK (restK loc)))]))? ? ; ;  T e s t s? (equal?? (all-bw? empty)? empty)? (equal?? (all-bw? (cons? RED? empty))? (cons? MID? empty))?  ? K ; ;  I m a g e  - >  I m a g eK ; ;  C o n v e r t  i m g  t o b l a c k  a n d  w h i t eK (defineK (image->bwK img)K K (color-list->imageK (all-bwK (image->color-listK img))K K (image-widthK img)K K (image-heightK img)K K (/K (image-widthK img)K 2)K K (/K (image-heightK img)K 2)))   (equal? (image->bw PNG  IHDR<(-#IDATxՙQ D k/4jύV7Z57rx?ڐ8>Fͣn3MO-9c)9%"}:TI,했\bIsJ1FedX qKA~O2VUQVckRJ)(X.tFP"& w1f#r}Y3~!8i89NRF$D.S_םB@I1#0GH`zGZ!UWj*bD ! 8w=,hp- ݟ GVrLܯVEl3aql vmB~fo cMH ?X7Yy"xT.;OT}aus6%%Uxr_LP7}l<39l޾PMҶa.roԊfhd>. ߛyC+`U&"0/._!LqJd)p "A^+ %p[hVsS)" o _qvE,6I9l oQl*CnUS~aqNeQ2b!!잵sh4n7UDQkE] =Ƶ֟iZc=UJ)2Yk*Ӏ:Z#gggE?cd1G!R wvvܳQEQ?Q "]fU !H# j12ut0iki&QPJi=Z&9uOynM18M:|į