Ok so I wrote and compiled my code: <div><br><div>[code]<br><div><div>;;check-color: symbol symbol symbol symbol -> symbol</div><div>;;consumes four colors. 1 player picks two colors, the 2nd player guesses the colors. check-color simulates the 1st players checking action. It consumes four colors. The 1st two arguments to check-color are "targets" and the latter two are "guesses". the function produces one of the four answers. </div>
<div>;;example: (master check-color) = 'Perfect</div><div>;; (masster check-color) = 'OneColorCorrectPosition</div><div>;; (master check-color) = 'OneColorOccurs</div><div>;; (master cheeck-color) = NothingCorrect</div>
<div>(define t1 'red)</div><div>(define t2 'green)</div><div><br></div><div>(define (check-color t1 t2 g1 g2)</div><div> (cond</div><div> [(and (= t1 g1)(= t2 g2)) 'Perfect]</div><div> [(or (= t1 g1)(= t2 g2)) 'OneColorOccurs]</div>
<div> [(or (or (= t1 g1)(= t1 g2))(or (= t2 g1)(= t2 g2))) 'OneColorOccurs]</div><div> [else 'NothingCorrect]))</div><div>[/code]</div><div><br></div><div>It compiles correctly, but then when I run it using the master.ss teachpack as told (master check-color) and choose two colors, I get the error:</div>
<div> =: expects type <number> as 1st argument, given: 'green; other arguments were: 'red</div><div><br></div><div>can someone explain what I did wrong and how to correct this. </div><div><br></div><div> </div>
Jeremy D. Duenas<br>714.864.9686<br> <br>
</div></div></div>