Thank you so much. I was able to figure it out. I don't know why I didn't think of utilizing the symbol=? <div>After re-reading the error and not over thinking it I was able to see what I needed to do </div><div><br clear="all">
Jeremy D. Duenas<br>714.864.9686<br> <br>
<br><br><div class="gmail_quote">On Mon, Jan 31, 2011 at 8:25 AM, Jeremy Duenas <span dir="ltr"><<a href="mailto:jduenas23@gmail.com">jduenas23@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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>
</blockquote></div><br></div>