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
Thomas Kahle
@tomkalei@machteburch.social
Der radfahrende podcastende antifaschistische Matheprof und Papa aus Magdeburg. Math professor at OvGU Magdeburg posting in English and German. When I was young, we used to compile our own operating systems.
Dauerkarte
Searchable on tootfinder.ch
machteburch.social
Thomas Kahle
@tomkalei@machteburch.social
Der radfahrende podcastende antifaschistische Matheprof und Papa aus Magdeburg. Math professor at OvGU Magdeburg posting in English and German. When I was young, we used to compile our own operating systems.
Dauerkarte
Searchable on tootfinder.ch
machteburch.social
@tomkalei@machteburch.social
·
23h ago
7
0
2
Loading comments...