This commit is contained in:
Miloslav Ciz 2024-02-17 10:47:29 +01:00
parent d52544f211
commit 2c60dc3a2e
22 changed files with 1722 additions and 1663 deletions

View file

@ -4,7 +4,7 @@ Quine is a nonempty [program](program.md) which prints its own source code. It t
From [mathematical](math.md) point of view quine is a fixed point of a [function](function.md) (not to be confused with [fixed_point arithmetic](fixed_point.md)) represented by the [programming language](programming_language.md). I.e. if we see the programming language as a function f(x), where *x* is source code and the function's output is the program's output, quine is such *x* that *f(x) = x*.
Similar efforts include e.g. making self matching [regular expressions](regex.md) (for this task to be non-trivial the regex has to e.g. be enclosed between `/`s).
Similar efforts include e.g. making self matching [regular expressions](regex.md) (for this task to be non-trivial the regex has to e.g. be enclosed between `/`s). Yet another similar challenge is a [polyglot](polyglot.md) program -- one that is a valid program in several languages -- some programs can be quines and polyglots at the same time, though these are super hard to make.
Quine can be written in any [Turing complete](turing_completeness.md) [language](programming_language.md) (according to [Wikipedia](wikipedia.md)), the challenge is in the [self reference](self_reference.md) -- normally we cannot just single-line print a string literal containing the source because that string literal would have to contain itself, making it [infinite](infinity.md) in length. The idea commonly used to solve this problem is following: