Skip to main content
2 of 4
added 162 characters in body

Self-Improvement

Your Task

You must create a self-mutable program that, when run, outputs a non-zero integer and also overwrites the file with a program that outputs double the number.

For example, if I run the program self-improvement and it outputs 10, it must output 20 when I run it the second time, output 40 the next time, and so on.

Additional Notes

  • You must not rely on any file on the computer other than your program.
  • Said program must consist of only one file.
  • Of course, no loopholes that are banned from the entire site.
  • You can assume that you won't go beyond the INT_MAX or INT_MIN of your preferred language (eg. I won't require you to output above 9223372036854775807 in Python).