38
1
A 1-up quine is a program which is very similar to a quine. The one major difference is that instead of printing itself once, when n copies of the program are concatenated, the result prints the original program n+1 times.
Example
If your program is Abc123
:
Abc123 -> Abc123Abc123
Abc123Abc123 -> Abc123Abc123Abc123
Abc123Abc123Abc123 -> Abc123Abc123Abc123Abc123
Challenge
Your challenge is to create the shortest valid 1-up quine in any language. The usual quine rules apply, so you may not:
- Submit the empty program.
- Directly or indirectly read1 the source code.
- Use quining built-ins.
This is code-golf, so shortest code in bytes wins.
1This does not include using a hard-coded string or code block as part of your program.
2Is it ok if
n
is limited by some data type restriction (maximum integer size etc)? – Luis Mendo – 2016-02-15T21:55:01.2572@LuisMendo I think that's OK, as long as you can support a reasonable number of repeats (100, maybe). – ETHproductions – 2016-02-15T22:52:47.990
Is reading the length of the source code using a builtin quining method okay? – Conor O'Brien – 2016-02-16T13:22:26.280
2@CᴏɴᴏʀO'Bʀɪᴇɴ That seems a little too similar to getting the source code itself to me, since you're still getting information about the source code. So no. – ETHproductions – 2016-02-16T15:24:23.470