18
2
A half cardinal cyclic quine is a cyclic quine with two states, one perpendicular to the other.
Rules
You can decide which rotation you want to implement, clockwise or counter-clockwise.
Once rotated, any gaps in your code should be replaced with spaces to preserve the positioning.
Your program must satisfy the community definition of a quine.
This is code-golf so the shortest program in each language wins. Your first program is used for your byte count.
Standard loopholes are forbidden.
Examples
If your program is:
$_='print';eval
Then the next iteration must be either:
$
_
=
'
p
r
i
n
t
'
;
e
v
a
l
or
l
a
v
e
;
'
t
n
i
r
p
'
=
_
$
which must output the original program:
$_='print';eval
If your program is:
;$_=';
;$_=';
print
Then the next iteration must be either:
;;
''t
==n
__i
$$r
;;p
or:
p;;
r$$
i__
n==
t''
;;
which must output the original program:
;$_=';
;$_=';
print
Related. – Dom Hastings – 2018-02-28T20:14:52.323
1Somewhat related. – Martin Ender – 2018-02-28T20:17:34.170
So, we pad the code with spaces to keep its shape after turning? – Erik the Outgolfer – 2018-02-28T20:23:12.333
@EriktheOutgolfer Yes, I'll confirm that in the body, thanks! I've also clarified that the first program is the byte-count used. – Dom Hastings – 2018-02-28T20:30:31.090
Is the only difference between this and the post @MartinEnder linked that that is a transpose and this is a rotation? – dylnan – 2018-02-28T20:56:13.530
1@dylnan No, the other one doesn't ask for a mutual quine. – Martin Ender – 2018-02-28T20:57:34.143
1Having seen the answers so far I think the real challenge would be the anticlockwise one or a quine with more than one lines (so that rotation is different from transposition or simply inserting newlines). – Weijun Zhou – 2018-02-28T21:30:02.600
@WeijunZhou Indeed, I'm not sure how feasible it is, but I have a more complex version of this in the sandbox.
– Dom Hastings – 2018-02-28T21:32:35.830Are the quine and its rotation allowed to be the same? – mbomb007 – 2018-02-28T21:40:58.227
1You might want to require the two programs to be different. Otherwise, quines which happen to have rotational symmetry would be valid answers. – Martin Ender – 2018-02-28T21:41:04.750
And the same applies to the one in the sandbox – mbomb007 – 2018-02-28T21:41:58.283
I really want to see an answer in Python, even if it has symmetry. I'm getting stuck – mbomb007 – 2018-02-28T22:55:38.110
@mbomb007 I'm not sure I feel the programs have to be different, I think a quine that can be rotated would be valid as I feel that might be a challenge on its own. Does that help you compete (not really I'm guessing, by the last comment!), I would love to see a Python solution! – Dom Hastings – 2018-03-01T08:53:02.753
I sure hope no lovely red birds are going to be harmed in the course of this contest... – GNiklasch – 2018-03-01T11:32:52.217
I think another interesting scoring method would be
max(width, height) ** 2
, so getting your program to be more square would be incentivized. – mbomb007 – 2018-03-01T14:13:28.327@mbomb007 I quite like that... Perhaps a challenge to create a quine that is the same when rotated 90° using that scoring mechanism? – Dom Hastings – 2018-03-01T14:26:20.133