Write a proper quine containing at least one newline/linefeed whose every unfurling is either itself a proper quine or outputs the original quine. Your answer can mix and match outputting itself and outputting the original quine.
Unfurlings
Unfurlings consist of:
- Appending spaces to make the input a rectangle.
- Taking all lines above the bottom one and rotating them a quarter-turn clockwise about the lower-right corner so that the right edge is on the same level as the bottom edge.
- Repeat step (2) until the string is a single line to find all unfurlings.
For example, the first unfurling of
GFE
HID
ABC
is
HG
IF
ABCDE
and the rest are
HG
IF
ABCDE
IH
ABCDEFG
I
ABCDEFGH
ABCDEFGHI
This process is automated with this program adapted from Emigna's answer here,where each step of unfurling in the output is delimited by a dashed line.
Example
For example, if you have a program
K
AB
(no trailing spaces)
then it must be a proper quine and print itself('K\nAB'
, where \n
represents a linefeed/newline).
According to the output of the unfurling program, we see that the next step in unfurling is
K
AB
(note trailing space)
This must either print itself(' K\nAB '
) or the original program ('K\nAB'
).
The next step in the unfurling is
AB K
This must either print itself ('AB K'
), or the original program('K\nAB'
).
The byte-count of this program is 4
(K
, \n
, A
, B
).
Score
This is code-golf, so the shortest answer in bytes wins. Standard loopholes apply, as usual.