9
Find Hole 1 here.
Make a quine that, when run, outputs its own source code block multiple times. In fact, it must output it n times, where n in the next prime number.
I think an example shows it best.
[MY QUINE][MY QUINE]
[MY QUINE][MY QUINE][MY QUINE]
[MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE]
[MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE]
[MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE]
Each Program will output its base "block" (so [MY QUINE]) the next prime number times.
Built in functions to calculate whether a number is prime, (like an isPrime function), or to determine the next prime (like a nextPrime() function) are not allowed.
- This means that functions to list the number of divisors is not allowed
- Functions that return the prime factorization are likewise disallowed
This should be a true quine (except for some leeway, see next point), so you should not read your own source code.
Because languages like Java and C# are already at a disadvantage, You need not output totally working code. If it could be put in a function (that is called) and output the next quine, you are good.
This is code-golf, so shortest code wins!
No one answered hole 1, so what score does everyone answering this one get for the first hole ? – Optimizer – 2014-10-15T11:48:19.967
1Could you clarify the part with the prime functions? Can we use them or can we not use them? – Martin Ender – 2014-10-15T12:02:36.600
3What is considered prime checking and what is not? Considering that prime checking can be built using any quine if this sort, the rules are not clear enough – proud haskeller – 2014-10-15T12:09:55.910
@Optimizer: Everyone has a score of 0 for the first hole until someone answers it. – Stretch Maniac – 2014-10-15T21:38:40.777
@MartinBüttner modulo is fine, and in this case Divides would also be fine (sorry for the confusion). I am just excluding functions in which it outputs either a) the next prime or b) if a number is prime. – Stretch Maniac – 2014-10-15T21:53:08.607
@MartinBüttner That effectively tells you if a number is prime and is not allowed. Sorry. – Stretch Maniac – 2014-10-15T22:16:22.203
2@StretchManiac You should clearly mention in the question that both list of prime factorization methods and list of divisors methods are also not allowed. Please post the question in the Sandbox next time. – Optimizer – 2014-10-16T05:29:42.893