Skip to main content
3 of 3
added 108 characters in body
Matthew Roh
  • 5.4k
  • 3
  • 30
  • 61

Implement the Fibonacci-quine

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!

Matthew Roh
  • 5.4k
  • 3
  • 30
  • 61