Below, you can find another hint for the Generalized Challenge.
You should only get here after reading, digesting, and applying the .
Let us consider some of the specific definitions of function f.
In this case, it is fairly straightforward to come up with an ad hoc solution:
This program consists of one line and it outputs one.
This is only slightly harder, and requires a bit of tinkering:
or
This can be viewed as a simplified version of a self-reproducing program.
An ad hoc and ugly formatted solution:
:
Using a for-statement, omitting redundant braces, and forgetting the end-of-line, this can be somewhat shortened:
:
Omitting the braces around the else-part would require the introduction of an additional space between else and write.
This looks like a variant of a self-reproducing program.
This also looks like a, slightly harder, variant of a self-reproducing program.
Why don't you try to adapt a self-reproducing program from the first Challenge, for instance, the one in Hint 39, to solve these problems.
It is your turn ...
If you have no idea how to get started, or if you tried some programs and do not see how to proceed, then you are ready for the .