Build a half cardinal cyclic quine

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 so the shortest program in each language wins. Your first program is used for your byte count.

Standard loopholes are forbidden.

Examples

$_='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


;$_='; ;$_=';
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

• Feb 28, 2018 at 20:14
• Somewhat related. Feb 28, 2018 at 20:17
• @dylnan No, the other one doesn't ask for a mutual quine. Feb 28, 2018 at 20:57
• Having 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). Feb 28, 2018 at 21:30
• You might want to require the two programs to be different. Otherwise, quines which happen to have rotational symmetry would be valid answers. Feb 28, 2018 at 21:41

CJam, 1917 15 bytes

{s"_~"+N*""-}_~


Explanation

{s"_~"+  e# Standard quine framework. Puts a string representation of the entire
e# program on the stack.
N*     e# Riffle linefeeds into the string, which is effectively a clockwise
e# rotation by 90°.
""-    e# Does nothing.
}_~


In the rotated code, we've got linefeeds everywhere:

{
s
"
_
~
"
+
N
*
"
"
-
}
_
~


As Lynn noticed on Dom's earlier quine challenge inserting linefeeds actually still forms valid quine, because the linefeeds inside the block will just be retained verbatim anyway, and there will also be linefeeds in the "_~" string to make those two characters at the end show up on their own line. So {s"_~"+...}_~ (with linefeeds) is still a valid quine framework (although there'll be an additional linefeed at the end of the string). N* now inserts even more linefeeds into that string, but we don't really care: because now ""- has a linefeed inside that string so it actually removes all linefeeds from the program representation. So we end up with the horizontal form of the code again, undoing the rotation.

Stax, 28 bytes

"8H^Hs+2*A]/Mm"8H^Hs+2*A]/Mm


Run and debug the first form

Run and debug the second form

><>, 22 bytes

 "2+}>oao#ov*48}}*d3'v


Try it online!

Rotated anti-clockwise:

v
'
3
d
*
}
}
8
4
*
v
o
#
o
a
o
>
}
+
2
"



Try it online!

The first one prints the line in reverse with newlines interspersed, and the second prints it in reverse without the newlines.

• This is very clever! Mar 1, 2018 at 1:35
• Good going on approaching it on hard mode! Mar 1, 2018 at 2:56

05AB1E, 36 34 bytes

4"D6Ø·çýD¶åi¶KëS»"D6Ø·çýD¶åi¶KëS»