a03sol-cs135-w10

a03sol-cs135-w10 - ;: s35 KHLJfiLiOHS ;: JHEJ LUHJHAK F...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ;: s35 KHLJfiLiOHS ;: JHEJ LUHJHAK F .r' I." '3 'L'I'i 5-1 I. . _"i i F: fluesL_on 2: iines.:kL {define—struct line {m o}} ;: .JlLEIHEH? ion : ._ine _L_ne —fiv {tnifui Eosn '.nifle£_:£ai} ;: Eroduces ;he intersection of {he Lwo given _ines |II :- _'_~::.": {check—espect {intersection {make—line 1 U} {make—line —1 0}} {mske—posn U 0}} {check—espect {intersection {make—line 1 U} {make—line —1 2}} {mske—posn 1 1}} {check—expect {intersection {make—line 1 U} {make—line 1 1}} Tundefined} {define {intersection line1 line2} {cono [{= {line—m linel} {line—m line2}} Tundefined] [else {mske—posn {I {— {line—b 1ine2} {line—b linel}} 4:- {line—m linel} {line—m line2}}}> {+ {* {line—m linel} {f {— {line—b ine {line—b linel}} {— {line—m 1i e1} ine—m line2}}}} {line—o 1ine1}}}]}} {check—expect {intersection {make—line 1 D} {mske—lin 1 }g;fu. efined} 1— ~l F: co_nc_den;? : 1_ne line _ine —} cooleen Ex) I II-IL' ;: Enswers LLLE lLI Lne given tiree 1_nes co nice 3. sl one coin; ;: issro_es: - a {check—espect {coincident2 {mske—li 1 U {m£;;—1i e 1 1} {make—line 2 9}} false} _ {check—expect {coincident2 {mske—li 1 {m e—line 2 U} {make—line 3 0}} true} {define {coincident? line1 line2 line3}m“_ {conci i [{equsl? line1 line2} {or {not {= {line—m line3} {line—m linel}}} {= {li e—b line3} {line—b linel}}}] [{equsl? line2 line3} {or {not {= {line—m linel} {line—m line2}}} {= {line—o linel} {line—o line2}}}] [{equsl? line1 line3} {or {not {= {line—m line2} {line—m linel}}} {= {line—o 1ine2} {line—o 1ine1}}}] [{posn? {intersection linel 1ine2}} {equs1? {intersection linel 1ine2} {intersection line2 line3}}] [else fslse]}} {check—expect {coincident? {make—line 1 U} {make—line 1 D} {mske—line 2 1}} true} {check—expect {coincident? {make—line 1 U} {make—line 1 D} {make—line 1 0}} true} {check—expect {coincident2 {make—line 1 D} {make—line 1 D} {mske—line 1 1}} false} ;: plus ens_ogiins LEE s for Iifi?lifi% seconc.{cni ;h_rc {Inuijflrsncces This document is for the exclusive use of x284”. F F {define—atruet eard F F v“- F F — {define {define {define {define {define {define {define {define {define {define {define {define {define {define {define {eheek—enpeet {define {eend [{and {equal? {ear rank {equalT { rd—r nk [{and {equal? {EEid—a it ear } {equalT { rd— it rd3}}} {value ear 2} {va ue rd3}}] {eard—auit eardl} {gard suit a 2}} {+ {value eardl} “ {value eard3}}] {eard—auit eard2} {+ {value eardE} [{equal? [{equal? [elae {man {value eardl} CDEHHLHEE QueaL_an a: a card la a in a HaL;2..lUl a is a Symbel fweDfSpadea aevenflfSpadea aevenflfHearta threeDfHearta naraa.:kL {rank auit}} wnere .Hr 1') .E' {mane—Card : a}, SLifllCifile 1'." e: a Symbei i‘d, 'Q, d: a}, and {‘Spaaea, inearLa, Elude, 'diafenda} {make—card 2 Tapadea}} {make—card T 'apadea}} {make—card T 'hearta}} {make—card 3 'hearta}} kinngSpadea {make—card 'K 'apadea}} aeeDfSpadea aeeDfDiamenda {make—card 'a {make—card 'apadea}} Ta Tdiamenda}} jaekDfSpadea {make—card 'J 'apadea}} fiveDfHearta {make—card 5 'hearta}} kinngHearta {make—card 'K 'hearta}} tweDfDiamenda fiveDfDiamenda fiveDfCluba nineDfCluba teanCluba hand—value: 'I - - ' - ---'\-u'\--\.--{ yr.- -I . _HLWU_E3. {hand—value eardl eardE eard3} {+ {mas {man I," If: :1 1" £15.13 {LEI-1C3. If. :.'.:m[::- '._i l. E- {make—eard 2 'diamenda}} {make—card 5 Tdiamenda}} {make—card 5 Teluba}} {make—card 9 Teluiaa}} {make—card 1U Teluiaa}} card card card —a num 1. IE E‘- C CI :E 5:; 1': If: 53' .E'IL'.‘-._ f". {hand—value tweDfSpadea threeDfHearta kin ard2}} rd3} } 30.5] D Spa eardl} eard2} eardl} eardE} {card—rank {card—rank {eard—auit {card—suit {value eardl} [{equal? {value teed2} / {eard—Bfiuit eard3}} {value eard3}} {value eard3}}] {mas {eard—auit eardl} {+ {value eardl} {eard—auit eard3}} {value eard3}} {value eard2}}] {eheek—eapeet {eheek—eapeet {cheek—expect {cheek—expect {cheek—expect FF FF F F {eheek—eapeet {eheek—enpeet "-.-" {-1 _ '..i E I _.-.. .-. . .-.., '5.- fn. .E LA. 'I - - ' - ---'\-u'\--\.--. «.rur -I - _Emmu_hn. {value eard2} {value eard3}}]}} hand—value aeeDfSpadea kinngSpadea jaekDfSpadea} 31} fiveDfHearta fiveDfDiamenda fiveDfCluba} 3U.5} fweDfSpadea aeveanSpadea aeeDfDiamenda} ll} aevenflfHearta fiveDfCluba fweDfDiamenda} T} nineDfCluba fiveDfCluba kinngHearta} lfl} { {hand—value {hand—value {hand—value {hand—value a... —2 naL Chanaumea aicnflrd anu.fnxfia41ea iijiiilmeriCHL; value {value aeeDfSpadea} 11} {value tweDfSpadea} 2} This document is for the exclusive use of x284”. {define {value aeard} {eund [{number? {card—rank aeardl} {card—rank aeard}] [{avmbel=? {card—rank aeard} 'A} ll] [elae lfl]}} {cheek—expect {cheek—expect {cheek—expect {cheek—expect value aeeDfSpadea} ll} value nineDfCluba} v} value teanClube} l3} value jaekDfSpadea} lU} This document is for the exclusive use of x284”. ...
View Full Document

Page1 / 3

a03sol-cs135-w10 - ;: s35 KHLJfiLiOHS ;: JHEJ LUHJHAK F...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online