You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By brute-force search I can now rule out all possible combinations of +-[]<>. of length 8 or less. So the true answer is anywhere between 8 and 400.
Open question: What is the relationship between length, steps and cells/memory used in (bf) quines?
Things that can be said about potential shorter quines (if they exist)
Symbol
ASCII value
+
43
-
45
.
46
<
60
>
62
[
91
]
93
since the quine cannot be of length zero, it must contain at least one `.`
-> it must contain at least one `+` since the symbol . has to be output
-> this alone places a naive lower step bound of 48 (43 additions, 1 output, 3 additions, 1 output) for outputting the two symbols only. Since this cannot be accomplished with two symbols alone, the lower bound increases depending on whether a loop is used or not.
Do quines fundamentally HAVE TO use loops? In some languages, which can inspect their own source, perhaps not (?). But in BF, it's impossible to output the same number of characters as the source length without using one.
Therefore, a BF quine has to contain at least +.[], meaning at some point all the corresponding ASCII values have to reside in memory, the instruction pointer points to them at some step and the instruction . is used to output them.
(apart from the empty program of course)
The shortest I could find was this 400 byte beauty:
By brute-force search I can now rule out all possible combinations of
+-[]<>.
of length 8 or less. So the true answer is anywhere between 8 and 400.Open question: What is the relationship between length, steps and cells/memory used in (bf) quines?
Things that can be said about potential shorter quines (if they exist)
Do quines fundamentally HAVE TO use loops? In some languages, which can inspect their own source, perhaps not (?). But in BF, it's impossible to output the same number of characters as the source length without using one.
Therefore, a BF quine has to contain at least
+.[]
, meaning at some point all the corresponding ASCII values have to reside in memory, the instruction pointer points to them at some step and the instruction.
is used to output them.Things I've tried
Evolve them using genetic algorithms: https://github.com/void4/Brainfuck-Evolved (kurtjd/brainfuck-evolved#1)
The text was updated successfully, but these errors were encountered: