13
2
A Quine is a program which outputs its source when run.
In this challenge, You should make a Fibonacci-quine, a variant of the quine.
What is a Fibonacci-quine?
A Fibonacci-quine is a program, which outputs a modification of the source by the following rule:
The initial source should be ...2...
. In other words, the source should contain 2
. (Why 2? If it was 1, Nobody would know if it was the first 1 or the second, Even the program itself)
When run, You should output the source, but only the specific number (In this stage, 2
) changed to the next number of the fibonacci sequence. For example, ...3...
. Same goes for the output, and the output of the output, etc. You may support integers for up to 2^32-1. For integers over that limit, the next output is on your choice.
OP's note
I would really like to see a creative solution for this. I couldn't think of a single solution for this, since Both of the two important aspects of the challenge, fibonacci and quine, is not easy. I'll be waiting then!
Related. – Leaky Nun – 2017-05-08T11:25:07.237
4The quine part doesn't add much to this challenge. This is just "next value in Fibonacci sequence" plus a universal quine constructors, as the answers show. – None – 2017-05-08T17:08:26.220
I agree. I would like to see a creative solution for this as well. But if you want a creative solution so bad, then why not make it a code-challenge instead of code-golf. The winning criteria could be the highest number of votes after some time interval or something. – Fixed Point – 2017-05-08T18:52:23.427
@FixedPoint What about a 'Second criteria'? Someone makes a creative solution, I give them bounty. – Matthew Roh – 2017-05-09T00:17:36.687
@FixedPoint That's a [tag:popularity-contest] – boboquack – 2017-05-09T10:40:50.253