<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Appreciate all the replies I got. Sorry I'm not able to reply back personally to all. I guess we're supposed to just post everything to this list email and let all users check it out, right? <div><br></div><div>Can someone please tell me if the following code happens to be the solution to this problem? </div><div>( 5.1.3. at <a href="http://htdp.org/2003-09-26/Book/curriculum-Z-H-8.html">http://htdp.org/2003-09-26/Book/curriculum-Z-H-8.html</a> )</div><div><br></div><div><div>;; check-guess3, exercise 5.1.3.</div><div><br></div><div>;; defined function 'guess' as a number made up of three concatenated input digits according to required significance (problem states that digit1 is the least significant, and digit3 is the most significant)</div><div><br></div><div>(define (guess digit1 digit2 digit3)</div><div> (+ (* digit3 100) (* digit2 10) digit1))</div><div><br></div><div>;; proceeded to define the condition 'check-guess3' that compares the 'guess' number to the 'target' number</div><div><br></div><div>(define (check-guess3 digit1 digit2 digit3 target)</div><div> (cond</div><div> [(< (guess digit1 digit2 digit3) target) 'TooSmall]</div><div> [(= (guess digit1 digit2 digit3) target) 'Perfect]</div><div> [(> (guess digit1 digit2 digit3) target) 'TooLarge]))</div></div><div><br></div><div><br></div><div>When I test the function 'check-guess3' at the interactions window, it seems to work fine.</div><div>But when I switch over to the gui window and approach the supposed target number, then no matter what I choose it's either 'TooSmall or 'TooLarge. Never get the 'Perfect result like when I test this in the interactions window.</div><div><br></div><div>What am I doing wrong?</div><div><br></div><div>(My thanks to Jens, Paul and Ken for their replies)</div><div><br></div><div><br></div></body></html>