A quine is a computer program that prints its own source code. Such a program exists in any sufficiently powerful programming language by Roger's fixed point theorem.

A quine cannot contain all of its source code as a string which it then prints. One needs a trick.

One trick is to decompose the program into 3 parts. P, a Preamble, S.quote, a tail-string S of the program quoted in the programming language, and then the literal tail string S.

The program is P++S.quote++S

1/2