📋
About This repository holds all of the solution code for the Advent of Code 2021 event. All solutions are done in Python 3.9.9 and done in non-real time (i.e. I didn't do them each on the days that they came out).
💭
General Philosophy The goal of each solution isn't to use the fewest lines of code or to produce the most condensed solution (i.e. code golfing), but instead to attempt to write a simple solution that is relatively well-documented and organized (most documentation will be missing from the code itself, as the actual spec lives on the Advent of Code 2021 site, but purpose statements and type hints should be present).
📦
Organization Each day's solution can be found in the solutions
directory with the naming convention of day_name_as_integer.py
(e.g. the solution for day 1 is 1.py
) with the neccesary input file living in the inputs
directory with the naming convention of day_name_as_integer.py
(e.g. the input for day 1 is 1.txt
). The common
directory holds all common/shared functions.
solutions: all of the solution code
|
|
+-- common: commonly used functions and whatnot
| |
| +-- input.py: reading input files
| |
| -
|
+-- inputs: input files
| |
| +--- 1.txt: input for day 1
| |
| +--- 2.txt: input for day 2
| |
| ~
| ~ every file follows the above naming convention
| ~
| |
| -
|
+-- 1.py: solution for day 1
|
+-- 2.py: solution for day 2
|
~
~ every file follows the above naming convention
~
|
-
⚙️
Build and Run To install the necessary dependencies for each day's solution, use the following commands while in the advent-of-code-2021
directory (not the solutions
directory!):
# to install dependencies
make setup
# to run the solution for a particular day
make run day=day_as_integer
# example: run the solution for day 1
make run day=1