<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">The exercise can be found at:<a href="http://htdp.org/2003-09-26/Book/curriculum-Z-H-40.html#node_sec_32.2">http://htdp.org/2003-09-26/Book/curriculum-Z-H-40.html#node_sec_32.2</a><br><br>I am stuck at 32.2.6-.7<br><br>I originally had some information incorrect and was able to get mc-solution working correctly, except it didn't need someone to remain on the boat at all times. So it just moved 1m 1c, than 2m, and finally 2c. I found out why this happened and edited the possible-move function to take into account the boat position before making calculations. This worked great but now I am having trouble getting mc-solution working correctly. I didn't do it exactly as the book wanted, instead I had a helper function which determined if some state could reach a final state, if it could, it produces true. To get mc-solutions to produce the list of moves to final I
 used the first function and tested it at every step, if it returned true, I added the state to an accumulator. When I reached a final state I returned the accumulator.<br><br>I am having trouble creating the first function right now, I know if I can figure it out I can easily finish.<br><br>1.My thought is to test the input state, if it's final, return true.<br>2.else, locally define next-moves which is a list of legal possible moves.<br>3.Test if (first next-moves) is in the accumulator, if it is apply to rest next-moves.<br>4.Test if next-moves is empty, if it is return false.<br>5.recur on first in next-moves, add input state to accumulator.<br>6. recur on rest in next-moves.<br><br>The problems I have faced is, it is searching a list of listof states, and when it applies final on rest next-moves, the function which tests final throws an error. I was able to fix this, although, probably not correctly, but this "solution" caused an infinite loop. I
 need some help here. If you would like to see the code I have just let me know.<br><br>For the proper way I should have gone which Im also playing around with, I am slightly confused by the wording in the book.<br><br><b>Exercise 32.2.6.</b>&nbsp;&nbsp;  
Develop <code class="scheme"><span class="variable">mc-solvable?</span></code>, which consumes a list of states and
generates the list of all successor states until it has found a final
state. The function should simply produce <code class="scheme">true</code> when it finds a final
state<br><br>It simply wants true or false, and not a list to false, right?<br><br>Im thinking that the goal is to define mc-solvable? and use it in mc-solution sort of like the backtracking algorithm for finding-route.<br></td></tr></table><br>