This script generates a template for solving Advent of Code problems. It fetches the input and test data for a given year and day, and creates the necessary files to start solving the problem.
To use the script, run the following command:
python init.py <year> <day>
Replace <year>
with the year of the Advent of Code event and <day>
with the day of the problem you want to solve.
- Python 3.6 or higher
- requests library
- beautifulsoup4 library
- python-dotenv library
You can install the required libraries using pip:
pip install -r requirements.txt
Create a .env
file in the same directory as init.py
with the following content:
SESSION=<your_session_cookie>
Replace <your_session_cookie>
with your actual session cookie from the Advent of Code website.
The script performs the following steps:
- Validates the environment variables.
- Generates the template files for the given day.
- Interacts with the user to run the solution and submit the answers.
To generate the template for December 1, 2021, run:
python init.py 2021 1
This will create the necessary files and directories for solving the problem
If you find a bug or have a feature suggestion, pull requests are welcome. Please ensure your code follows the project's coding standards and includes appropriate tests.