<br>I removed the bugs from the cond condition .<br><br>(define check-guess3 (lambda(lsb csb msb target)<br> (cond<br> [(< (guess lsb csb msb) target) 'Toosmall]<br> [(= (guess lsb csb msb) target) 'Perfect]<br>
[else 'Toolarge])))<br>(define guess (lambda (lsb csb msb)<br> (+(* msb 100)(* csb 10) (* lsb 1))))<br><br><br>For removing the function call twice with the same argument i can i call it before cond and store the return value in a variable .can it be done like this<br>
<br>(define check-guess3 (lambda(lsb csb msb target)<br> define guess-n (guess lsb csb msb)<br> (cond<br> [(< guess-n target) 'Toosmall]<br>
[(= guess-n target) 'Perfect]<br> [else 'Toolarge])))<br>(define guess (lambda (lsb csb msb)<br> (+(* msb 100)(* csb 10) (* lsb 1))))<br><br><br>
After doing this i get the error<br><br>lambda: expected only one expression for the function body, but found at least one extra part<br><br>How can i fix this error?<br><br><br>Aditya<br><br>