18
1
It's August 10th, 2019, but your task still involves Y2K. Weird, right?
Create a program that prints itself, with a two digit number appended to it. The first time you run it, it should append 00 to its output (its source code, because this is a quine variant). When you run that output, the original program without a two digit number, it should output the original program, but with 01 appended to it. Run that output to get the OG program with 02 appended, then that to get the program with 03... This chain should continue until 99. That program should output BREAKING NEWS: WORLD ENDS
.
If your program is Y2Kparanoia: yes
then:
- It should output
Y2Kparanoia: yes00
- That output should print
Y2Kparanoia: yes01
- That output should print
Y2K paranoia: yes02
- Repeat until step 100: this program outputs the doomsday news specified
This is code golf, so the shortest program that can print itself while following these steps wins.
7According to the description the 99th time we run we'll be running
2Kparanoia: yes97
and producing2Kparanoia: yes98
, so shouldn't (4) readRepeat to step 100, but step 101 will output "BREAKING NEWS: WORLD ENDS"
? (i.e.2Kparanoia: yes99
produces the news) – Jonathan Allan – 2019-08-10T16:51:49.330