My solutions to Advent of Code puzzles, written in Python.
đź“‚AoC
├─── 📄template.py
└─── 📂YEAR
├─── 📂inputs
| └─── 📄day-N.txt
└─── ⚙️day-N.py
- The file
đź“„template.pycontains a template for the files with the solution code of the day. - The folders
đź“‚YEAR(named after the year, e.g.2024) contain all the files related to the year. - The files
⚙️day-N.py(whereNis the number of the day, e.g.day-1) contain the solution code of the day. - The
đź“‚inputsfolder contains all the input files (named the same way as the solution code files, but with the.txtextension).
The đź“‚inputs folder isn't in the repository's code, according to the Advent of Code ToS, but is required to run the code.
- Make sure that you have Python installed on your device.
- Clone the repository in your device.
- Open the repository using the console of your OS (e.g. cmd for Windows).
- Start the desired file using the command
python YEAR/day-N.py, replacingYEARwith the year andNwith the day of the puzzle you want to see the code (e.g.python 2024/day-1.py).
Before the last step, make sure that you have created the đź“‚inputs folder inside the selected year and that you have created, inside that folder, the day-N.txt file, containing the input of the puzzle.
You can get your puzzle input subscribing to Advent of Code and going to the URL https://adventofcode.com/YEAR/day/N/input.
As always, YEAR is the year and N is the day of the desired puzzle.
This software is shared as open source. However, if you use it in your own solutions, consider giving acknowledgement to me, linking back this repo.