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

Eliminating the use of substr(), we obtain the program:

It outputs ():

Note that this output is again a program that writes itself ().

The program got a bit longer, and so did the string literal. (In the back of our minds, we still know that we have to break up the string so as to distribute it over multiple lines.)

N.B. Strictly speaking, the first loop is not needed. We could still use substr() there. But you can find a way to merge the two loops into a single loop.

Can you now insert newline markers (e.g. '|') in the string literal, and recognize these markers in the second loop and convert them into newlines?

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