Skip to main content
added 596 characters in body
Source Link
Martin Ender
  • 198.3k
  • 67
  • 455
  • 999

CJam, 13 bytes

{_o"_g
"o1}_g

The online interpreter doesn't print anything before the program terminates, so you'll have to test this in the Java interpreter.

Explanation

Finally a generalised CJam quine which doesn't end in _~.

{_o"_g
"o1}

This simply pushes a block. _g duplicates the block and executes it repeatedly while the top of the stack is truthy (discarding the condition).

Now inside the block, the other copy of the block is still on the stack. We duplicate and print it with _o and then we print _g followed by a newline (the required extra newline between quines) with "_g\n"o. Finally we push a 1 onto the stack for the loop to repeat, because unfortunately, blocks aren't truthy (or falsy) in CJam.

CJam, 13 bytes

{_o"_g
"o1}_g

The online interpreter doesn't print anything before the program terminates, so you'll have to test this in the Java interpreter.

CJam, 13 bytes

{_o"_g
"o1}_g

The online interpreter doesn't print anything before the program terminates, so you'll have to test this in the Java interpreter.

Explanation

Finally a generalised CJam quine which doesn't end in _~.

{_o"_g
"o1}

This simply pushes a block. _g duplicates the block and executes it repeatedly while the top of the stack is truthy (discarding the condition).

Now inside the block, the other copy of the block is still on the stack. We duplicate and print it with _o and then we print _g followed by a newline (the required extra newline between quines) with "_g\n"o. Finally we push a 1 onto the stack for the loop to repeat, because unfortunately, blocks aren't truthy (or falsy) in CJam.

Source Link
Martin Ender
  • 198.3k
  • 67
  • 455
  • 999

CJam, 13 bytes

{_o"_g
"o1}_g

The online interpreter doesn't print anything before the program terminates, so you'll have to test this in the Java interpreter.