[Oberon] Eliminating RETURN statements
hklaver at dds.nl
Thu Apr 9 00:27:00 CEST 2020
Karl and Diego,
Thanks for your proposal and comment.
I agree with Diego that Karl's version of the algorithm is the most concise and perspicuous one, giving the correct reference output.
> Diego Sardina wrote:
> August Karlstrom wrote:
>> Here is an alternative:
>> PROCEDURE Fit (i, j: INTEGER): BOOLEAN;
>> VAR k: INTEGER;
>> k := 0;
>> WHILE (k <= piecemax[i]) & ~(p[i, k] & puzzl[j + k]) DO
>> RETURN k > piecemax[i]
>> END Fit;
> This is the best way to write the algorithm, by putting the post-condition expression in the RETURN part.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Oberon