Transpose quine
Fission, 17 bytes
Still my favourite language for quines...
'"
!0
0+
;!
DN
"!
Try it online!
Explanation
This quite similar to the basic Fission quine. In fact, if it wasn't for the "must have at least two lines with at least two non-newline characters each" rule, I simply could have transposed that and replace R
with D
. That rule makes things a bit more interesting though, because we need to print another line.
Control flow starts at the D
with a single atom going south. Since it hits the "
it will wrap around and print
'!0;D
to STDOUT, similar to how it would in the normal quine. '!
then sets the atom's mass to the character code of !
. The 0
is a teleporter which transports the atom to the second column, where it's still moving south.
With +
we increment the atom's mass to the value of "
. !N!
the prints quote, linefeed, quote. STDOUT now looks like this:
'!0;D"
"
After wrapping around, the atom hits another "
and now prints the second line verbatim:
'!0;D"
"0+!N!
We're done now. The atom uses the teleporter once again, and lands in the ;
which destroys it and thereby terminates the program.
I suppose the neatest bit here is putting one "
at the bottom and the other at the top so that I can print them in one go without having to set the value of !
once more (because it would get overwritten by entering string mode again).
CJam, 14 bytes
{`"_~".+N*}
_~
Test it here.
While shorter, probably a bit less interesting than the Fission solution.
Explanation
{ e# Quine framework. Runs the block while another copy of it is on the stack.
` e# Stringify the block.
"_~" e# Push the remaining code as a string.
.+ e# Element-wise append... essentially puts the two strings in a grid and
e# transposes it.
N* e# Join with linefeeds.
}_~
Javascript ES6, 90 bytes
$=_=>[...(_=`$=${$};$()`.split`
`)[0]].map((x,y)=>_.map(v=>[...
v][y]).join``).join`
`;$()
Not bad, not bad.
Explanation
Here's the standard quine framework:
$=_=>`$=${$};$()`;$()
To modify, I just split the quine string along newlines and chars to create a matrix of chars, transposed using 2 map functions, and joined to create the output.