Programs
Self Source Code
 previous   up   next 

Self is a self-reproducing program. It takes no input and writes its own source code. Such programs are also known as quine (a reference to the philosopher Willard Van Orman Quine).

The program consists of two parts:

  • A string containing the code of part 2.
  • Code to write the string two times:
    • As string literal (with backslash escaped quotes, etc.).
    • Directly without any change.

The comment block with the copyright notice is not considered as part of the program to be written.


Output of self-reproducing program

 previous   up   next