My Advent of Code solutions for 2020-2024
Find a file
AKP bdc95074df
2023.07
Squashed commit of the following:

commit b15750b28c94f534a9a775112b961bdd9cecfde9
Author: AKP <abi@tdpain.net>
Date:   Thu Dec 7 16:55:14 2023 +0000

    Update `README.md`

commit baa6132676ad52a403fe8119cb829f3a9219691a
Author: AKP <abi@tdpain.net>
Date:   Thu Dec 7 16:53:55 2023 +0000

    Oh cool this works

commit 30b802851ae541e5354bc07806d9d576c5990bb5
Author: AKP <abi@tdpain.net>
Date:   Thu Dec 7 16:37:09 2023 +0000

    This kind of works
2023-12-07 16:55:32 +00:00
challenges 2023.07 2023-12-07 16:55:32 +00:00
templates Update main.py 2023-12-03 23:25:06 +00:00
.gitignore Add challenge day setup functionality 2023-11-29 10:42:49 +00:00
aoc Add test runner 2023-12-03 22:54:13 +00:00
LICENSE Update LICENSE 2022-12-02 12:27:34 +00:00
README.md Update README.md 2023-12-03 23:33:15 +00:00

Advent of Code 🎄

Jump to: 2020 - 2021 - 2022 - 2023

Solutions to Advent of Code challenges.

Puzzle inputs and descriptions are not included in this repository. You'll have to get these yourself from the AoC website. Here's why.

AoC website - AoC subreddit - AoC awesome list

Running solutions

The method of running solutions varies by year.

From 2023 onwards

Use the ./aoc script and provide it with the filename of the file you would like to run. For example, ./aoc run challenges/01-trebuchet/main.py.

Alternatively, run the code directly. Provide it with an input via stdin and set the first command line argument to be either 1 or 2 to run either part 1 or 2 respectively. This should go for all languages.

2021 and 2022

In order to run solutions from 2021 and 2022, you should switch to the 2022 branch first.

Solutions to 2021's and 2022's solutions are run via the runner program contained in ./runtime.

To run a solution, run go run github.com/codemicro/adventOfCode/runtime and follow the on-screen prompts. Configurisation options can be seen by running with the --help flag.

A benchmark graph can be generated using generate-benchmark-graph.py as follows: python3 generate-benchmark-graph.py <output file> <year>.

For example, to generate a graph for the 2021 benchmarks and save it to challenges/2021/running-times.png, you can run python3 generate-benchmark-graph.py challenges/2021/running-times.png 2021.

2020

In 2020, all solutions are in Python and/or Go.

  1. cd to the challenge directory eg: cd challenges/2020/05-binaryBoarding
  2. Run the desired implementation
    • For Python, run python3 ./py
    • For Go, run go run ./go

Dependencies for 2020 challenges are not neatly defined anywhere, so determing and installing the correct ones is an exercise for the reader.