Pages

2021/12/01

Advent of Code 2021

Just like last year, I am attempting the Advent of Code. Last time I managed to finish it in time, even if posting on the solutions was less punctual. I expect this time will not be different, I am not committing to write the blog posts every day; I will be happy enough if I can find the time to once again do each exercise on its day. This year's code will be in this repo in GitHub.

For convenience, I will repeat from the original intro post.

There are some general aspects of the repo, that may be relevant to highlight. First, the exercises for each day are in a puzzleXX.py file, where XX is the corresponding day. The puzzle input if needed is in a file with the same name and .in extension. In some cases the puzzle gives a smaller example that is useful for testing, and those have a .in.test extension; since each puzzle has a read_input() method, changing the file that is read there will switch between the full and test input. Remember that the input files are personalized, so using mine will not give you the right answer for you, you'll need to substitute your own input files.

The different aoc.* scripts help in removing boilerplate. aoc.py allows to run specific puzzles and parts, with aoc and aoc.bat being thin wrappers (for Linux and Windows, respectively) so that part p of day d can be run with [./]aoc d p. All puzzles return the expected answer so it can be copied directly.

I will link to the posts for each day below, or you can use the aoc2021 tag to filter them.

Links to posts:

No comments:

Post a Comment