Hints for the Challenge:

Below, you can find another hint for the Challenge.

You should only get here after reading, digesting, and applying the .

Hint

Now that was easier said than done. You may even have objected to our approach earlier on, when you saw the problem coming. If you try to incorporate the definition of copy() into the definition of S, then the quotes that occur in the body of copy() are problematic. They should have been avoided.

Quotes appear in three places: '|', '+', and '  '. The first occurence we already know how to eliminate, viz. by looking at the end of the string (we already did that before). The others also appear as substrings in S, so we can apply the same trick.

However, this requires some careful counting and is error prone. It also makes the program much harder to change. Do you see another solution?

Try your program in the machine, and see if you can extend it to a complete solution.

Apply the Hint

It is your turn ...

Need Another Hint?

If you tried this hint, or do not see how it helps, then you are ready for the .


Valid HTML 4.01 Transitional

Copyright ©2009, Tom Verhoeff, T.Verhoeff@TUE.NL