5
I personally love quines, but they all seem to be so... static. So why not create a quine that can do more.
Challenge
The challenge here is to create a quine that without any sort of input is a normal quine. Then if it receives a different input, it outputs a different quine in a different language. (basically like a polyglot, but it doesn't have to return to the original source code)
EX:
Starting program:
James
Given no input or 0 as input, the code above outputs:
James
Given 1 as input, the code outputs:
Kendra
Given 2 as input, the code outputs:
Alexander
And so on...
Requirements
Like with any other quine challenge, no examining source code directly!
Inputs are either nothing, or a positive integer.
Each quine must not be less than \$\lceil(n/4)\rceil\$ levenshtein distance from all other quines, where \$n\$ is the length of the original quine. Look at this example program:
Bobb //original quine
Bobby //output (when given an input), we'll name him bobby
Bob //output (when given a different input), we'll name him bob
The above is not valid, because Bob is only one levenshtein distance from Bobb.
However, this one is valid:
Bob //original quine
Alice //bob's output when given 1 as input
Geronimo //bob's output when given 2 as an input
Because \$ ceil(len(bob)/4)=1 \$, and Alice, Geronimo, and Bob are all at more than one levenshtein distance away from each other.
There has to be a minimum of one extra quine to be outputted.
The quine must output itself when given no input or 0, and output a different quine if given a different integer input!
Points
Points are based on this equation (courtesy of Luis felipe De jesus Munoz) $${\frac{100}{\text{bytes}} \cdot 2^{\text{extra quines} - 1}}$$
(100 divided by the number of bytes multiplied by 2 to the power of every different quine that your program can output, minus one to make sure the program at least outputs one different quine)
Comments are not for extended discussion; this conversation has been moved to chat.
– James – 2019-01-31T16:26:00.423Seems really close to the quine chaining challenge without as good of a specification. – Magic Octopus Urn – 2019-01-31T18:49:28.857
2I'm sorry, but this question is still entirely unclear. An extra quine only counts when it is not just appending, deleting or inserting characters into another quine format. That means that the outputs cannot be altercations of each other, nor can they be altercations of the original. Every string is just some other string with characters deleted and/or inserted. So the task would be impossible. And it's not clear what you mean by "altercation". Also, you didn't say anything about polyglots in the spec. – James – 2019-01-31T20:59:44.813
I suggest stating that each quine must be at least n levenshtein distance from each other, where n is a number of your choosing. – Embodiment of Ignorance – 2019-01-31T21:40:30.210
https://en.m.wikipedia.org/wiki/Levenshtein_distance – Embodiment of Ignorance – 2019-01-31T22:41:01.737
I think this new edit makes this challenge meet the requirements of this site. I would cast a reopen vote if I could, but the system doesn't let me because I cast one already before. – Embodiment of Ignorance – 2019-02-05T19:38:51.127
1
I have created a post on meta for you: https://codegolf.meta.stackexchange.com/questions/17365/should-a-multipurpose-quine-be-reopened
– Embodiment of Ignorance – 2019-02-06T21:45:20.467This doesn't really stop me from outputting infinite quines that are more than
n/4
characters away from each other, e.g. the ><> quines'rd3*>o<
,'rd3*>o<0000
,'rd3*>o<00000000
etc. – Jo King – 2019-02-07T13:06:42.490What constitutes a different language here? Our "default" definition is to say that different implementations are different languages (see here) which is quite fine grained and might not be suited to the challenge. Did you mean something else?
– Post Rock Garf Hunter – 2019-02-14T21:22:01.147