<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Karl and Diego,<br class=""><br class="">Thanks for your proposal and comment. <br class="">I agree with Diego that Karl's version of the algorithm is the most concise and perspicuous one, giving the correct reference output.<br class=""><br class=""><blockquote type="cite" class="">Diego Sardina wrote:<br class=""><br class="">August Karlstrom wrote:</blockquote><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Here is an alternative:<br class=""><br class=""> PROCEDURE Fit (i, j: INTEGER): BOOLEAN;</blockquote></blockquote><blockquote type="cite" class=""><blockquote type="cite" class=""> VAR k: INTEGER;<br class=""> BEGIN<br class=""> k := 0;<br class=""> WHILE (k <= piecemax[i]) & ~(p[i, k] & puzzl[j + k]) DO<br class=""> INC(k)<br class=""> END<br class=""> RETURN k > piecemax[i]<br class=""> END Fit;<br class=""><br class=""></blockquote><br class="">This is the best way to write the algorithm, by putting the post-condition expression in the RETURN part.<br class=""></blockquote><br class="">--<br class="">Hans Klaver<br class=""><br class=""></body></html>