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

So you could not think up anything to try, or you tried some programs but failed to solve the Challenge?

From the problem statement you can draw some conclusions:

  1. The program is not empty and finite.
  2. Hence, it consists of at least one statement.
  3. Since the output of the program equals the program text itself, the output of the program is also not empty.
  4. Consequently, the program must contain at least one call of the function writeln(), because that is the only way a prorgram can produce output.
    N.B. It is a good custom to terminate each output line, including the last one, by a newline, as produced by writeln(), but not by write().

It makes no sense to write a program that contains unnecessary things. So, let's try something really short:

where /*...*/ must be replaced by a suitable string to be output.

Because we now know what the first few characters of the program are, we also know what the first few characters are of that string to be output.

Can you put in a string to make a good start?

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 some programs like this and got stuck, then you are ready for the .


Valid HTML 4.01 Transitional

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