<p style="font-family: 'Times New Roman'; font-size: medium; "><b>Exercise 5.1.3.</b> Develop the function <code class="scheme" style="color: rgb(165, 42, 42); "><span class="variable" style="color: navy; ">check-guess3</span></code>. It implements a larger portion of the number guessing game of exercise <a href="http://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" style="color: rgb(165, 42, 42); "><span class="variable" style="color: navy; ">check-guess</span></code>. Now the teachpack hands over the <code class="scheme" style="color: rgb(165, 42, 42); "><span class="variable" style="color: navy; ">digits</span></code> that the user guesses, not the number that they form.</p>
<p style="font-family: 'Times New Roman'; font-size: medium; ">To simplify the problem a little bit, the game works with only three numbers. Thus, <code class="scheme" style="color: rgb(165, 42, 42); "><span class="variable" style="color: navy; ">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" style="color: rgb(165, 42, 42); "><span class="variable" style="color: navy; ">target</span></code> and represents the randomly chosen number.<span class="Apple-style-span" style="background-color: rgb(255, 255, 102);"> Depending on how <code class="scheme" style="color: rgb(165, 42, 42); "><span class="variable" style="color: navy; ">guess</span></code>, the number determined by the three digits</span>, relates to <code class="scheme" style="color: rgb(165, 42, 42); "><span class="variable" style="color: navy; ">target</span></code>, <code class="scheme" style="color: rgb(165, 42, 42); "><span class="variable" style="color: navy; ">check-guess3</span></code> produces one of the following three answers: <code class="scheme" style="color: rgb(165, 42, 42); "><span class="keyword" style="color: rgb(153, 0, 0); font-weight: bold; ">'</span><span class="variable" style="color: navy; ">TooSmall</span></code>, <code class="scheme" style="color: rgb(165, 42, 42); "><span class="keyword" style="color: rgb(153, 0, 0); font-weight: bold; ">'</span><span class="variable" style="color: navy; ">Perfect</span></code>, or <code class="scheme" style="color: rgb(165, 42, 42); "><span class="keyword" style="color: rgb(153, 0, 0); font-weight: bold; ">'</span><span class="variable" style="color: navy; ">TooLarge</span></code>.</p>
<p style="font-family: 'Times New Roman'; font-size: medium; ">The rest of the game is still implemented by <tt><strong>guess.ss</strong></tt>. To play the game with <code class="scheme" style="color: rgb(165, 42, 42); "><span class="variable" style="color: navy; ">check-guess3</span></code>, evaluate</p>
<div align="left" style="font-family: 'Times New Roman'; font-size: medium; "><pre class="scheme" style="margin-left: 2em; color: rgb(165, 42, 42); ">(<span class="variable" style="color: navy; ">guess-with-gui-3</span> <span class="variable" style="color: navy; ">check-guess3</span>)
</pre></div><p style="font-family: 'Times New Roman'; font-size: medium; "><br></p><p style="font-family: 'Times New Roman'; font-size: medium; ">What number is determined by the 3 digits? If the 3 digits were 1 2 and 3, does it mean that the number would then be 123? If that is the case how do you go about doing that? Because the initial set I thought would look like </p>
<p style="font-family: 'Times New Roman'; font-size: medium; "> (define (check-guess3 a b c target)</p><p style="font-family: 'Times New Roman'; font-size: medium; ">
but then it say depending on how <i>guess </i>relates to target, so it should still look like</p><p style="font-family: 'Times New Roman'; font-size: medium; "> (define (check-guess3 guess target)</p>
<p style="font-family: 'Times New Roman'; font-size: medium; ">and the variable <i>guess </i>should hold the number created by the 3 digits?!?!?!? Am I even close? I did 5.1.2 just fine, but this one is really confusing me. Any help is appreciated. </p>
<br><br> <br>