I am trying to solve this exercise from htdp <br><br><a href="http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-8.html">http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-8.html</a><br><br><b>Exercise 5.1.3.</b>&nbsp;&nbsp;
Develop the function <code class="scheme"><span class="variable">check-guess3</span></code>. It implements a larger portion of
the number guessing game of exercise&nbsp;<a href="http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-8.html#node_thm_5.1.2">5.1.2</a> than the function
<code class="scheme"><span class="variable">check-guess</span></code>. Now the teachpack hands over the <code class="scheme"><span class="variable">digits</span></code> that
the user guesses, not the number that they form.
<p>
To simplify the problem a little bit, the game works with only three
numbers. Thus, <code class="scheme"><span class="variable">check-guess3</span></code> consumes three digits and a number. The
first digit is the least significant, the third one is the most significant. The
number is called <code class="scheme"><span class="variable">target</span></code> and represents the randomly chosen number.
Depending on how <code class="scheme"><span class="variable">guess</span></code>, the number determined by the three digits,
relates to <code class="scheme"><span class="variable">target</span></code>, <code class="scheme"><span class="variable">check-guess3</span></code> produces one of the following
three answers: <code class="scheme"><span class="keyword">&#39;</span><span class="variable">TooSmall</span></code>, <code class="scheme"><span class="keyword">&#39;</span><span class="variable">Perfect</span></code>, or <code class="scheme"><span class="keyword">&#39;</span><span class="variable">TooLarge</span></code>.</p>

<p>
The rest of the game is still implemented by <tt><strong>guess.ss</strong></tt>. To play
the game with <code class="scheme"><span class="variable">check-guess3</span></code>, evaluate
</p>
<div align="left"><pre class="scheme">(<span class="variable">guess-with-gui-3</span> <span class="variable">check-guess3</span>)<br></pre></div><p>
after the function has been thoroughly tested.</p><p>My solution is like this</p>contract for check-guess3 <br><br>;; check-guess3 :: number * number * number&nbsp; * number &gt; symbol<br><br>header <br><br>(define check-3 (lambda(lsb csb msb number)....)<br>
<br>body<br><br>(define check-guess3 (lambda(lsb csb msb number)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cond<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [(&lt; guess(lsb csb msb) number) &#39;Toosmall]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [(= guess(lsb csb msb) number) &#39;Perfect]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [else &#39;Toolarge])))<br><br>contract for guess<br><br>;;guess :: number * number *number -&gt; number <br><br>header <br><br>(define guess (lambda(lsb csb msb)...)<br><br><br>body<br><br>(define guess (lambda(lsb csb msb)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is the part which i was not able to do , how can i combine lsb , csb and msb so the number is of the form (msbcsblsb) .Is there any function in scheme which can do this<br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ))<br>
<br>Any help is appreciated.<br><br><br>Aditya<br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br><br><br><br><br><br><br><br><br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br><br><br><br><br><br><br><br><br><p><br></p><p><br></p><p>
<br></p><p><br></p><br>