Reboot-Resistant Counter Challenge

Meetup: Wildcard Wizards Date: 2024-10-05

Background

You're tasked with creating a program that keeps track of how many times it has been run, persisting this count even through system reboots, without relying on any conventional storage methods.

Challenge

Develop a program that displays the number of times it has been executed, with the count persisting across multiple runs and system reboots. The catch? You cannot use any external files, databases, or network resources to store this information.

Requirements

  1. The program must be contained in a single file.

  2. No external storage mechanisms are allowed (no files, databases, environment variables, or network resources).

  3. Each time the program runs, it should display the current execution count.

  4. The count must persist accurately between executions AND system reboots.

  5. The program should be able to handle multiple executions and reboots without breaking or losing count.

  6. No AI or internet help - this must be solved by human ingenuity alone!

Example Output

First run (after fresh install or reboot):

And so on...

Evaluation Criteria

  1. Correctness: The solution must accurately track and display the number of executions, even across reboots.

  2. Self-containment: All tracking must be done within the single source file.

  3. Robustness: The program should handle repeated executions and system reboots without errors.

  4. Simplicity: Cleaner, more straightforward solutions will be favored.

  5. Creativity: Innovative approaches to solving the persistence problem will be highly regarded.

Good luck, and may your counter survive the test of reboots!