{"id":16542654,"url":"https://github.com/mjpieters/adventofcode","last_synced_at":"2025-08-21T20:31:36.079Z","repository":{"id":37774727,"uuid":"113661224","full_name":"mjpieters/adventofcode","owner":"mjpieters","description":"Advent of Code solutions 2015-2023","archived":false,"fork":false,"pushed_at":"2024-04-03T15:51:09.000Z","size":66441,"stargazers_count":150,"open_issues_count":5,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-14T23:42:06.378Z","etag":null,"topics":["advent-of-code","advent-of-code-2015","advent-of-code-2016","advent-of-code-2017","advent-of-code-2018","advent-of-code-2019","advent-of-code-2020","advent-of-code-2021","advent-of-code-2022","advent-of-code-2023","aoc","aoc2015","aoc2016","aoc2017","aoc2018","aoc2019","aoc2020","aoc2021","aoc2022","aoc2023"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjpieters.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-09T10:31:59.000Z","updated_at":"2024-10-15T19:57:37.000Z","dependencies_parsed_at":"2024-10-27T11:10:59.845Z","dependency_job_id":"b2ccf6d3-392d-4540-a4bf-d5a9af3cae17","html_url":"https://github.com/mjpieters/adventofcode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjpieters%2Fadventofcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjpieters%2Fadventofcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjpieters%2Fadventofcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjpieters%2Fadventofcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjpieters","download_url":"https://codeload.github.com/mjpieters/adventofcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230532400,"owners_count":18240788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advent-of-code","advent-of-code-2015","advent-of-code-2016","advent-of-code-2017","advent-of-code-2018","advent-of-code-2019","advent-of-code-2020","advent-of-code-2021","advent-of-code-2022","advent-of-code-2023","aoc","aoc2015","aoc2016","aoc2017","aoc2018","aoc2019","aoc2020","aoc2021","aoc2022","aoc2023"],"created_at":"2024-10-11T18:58:12.508Z","updated_at":"2024-12-20T03:55:02.902Z","avatar_url":"https://github.com/mjpieters.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of code solutions\n\n**Author**: [Martijn Pieters](https://www.zopatista.com)  \n**Twitter**: [@zopatista](https://twitter.com/zopatista)  \n**GitHub**: [mjpieters](https://github.com/mjpieters)  \n\nThese are my [Advent of Code][AoC] (AoC) puzzle solutions.\n\nMost recent solutions use [Python 3.12][pydotorg], and are presented in [Jupyter notebooks][jupyter] for easy [viewing on GitHub][github] or the [online Jupyter notebook viewer][nbviewer]. The latter is the better viewer, especially as Github's notebook rendered often breaks or at the very least filters out a lot of the interesting bits like animations.\n\nI don't aim to be first on any leaderboard. I aim to have fun solving the coding puzzles and playing with the concepts, and I try to include explanations of my thinking in the notebooks. Sometimes that means I'll include an animation or graph to show off some aspect of the puzzle.\n\n## Running locally\n\nEverything here is run through Jupyter notebooks. If you check out this repository locally everything is included to recreate my environment.\n\nI use [Pipenv][pipenv] to manage dependencies, make sure you [have it installed][pipenv_install] before continuing. Once installed, run\n\n```sh\n$ pipenv install\n$ ./start\n```\n\nand the jupyter notebook interface is automatically opened in your default browser. You can stop the server with the *Quit* button in the web interface, or with the `./stop` script.\n\nEverything is organised in per-year folders. I tend to update all the libraries and Python release each year, but I don't test if these updates caused issues with solutions for preceding years. If something broke, so be it.\n\n## Additional dependencies\n\n* Animations are produced using [matplotlib's animation API][mplanimation], which requires [ffmpeg][ffmpeg] to be installed. On Mac OS X just use `brew install ffmpeg`.\n\n* Graphs are plotted using [graphviz](http://www.graphviz.org/) command-line tools such as `dot`, `neato`, and `tred`. On Mac OS X, just use `brew install graphviz`.\n\n## Puzzle input data\n\nI use Wim Glenn's [`advent-of-code-data` package][aocdata] to load data directly from the AoC website. This library requires your AoC session cookie. You'll have create your own [Advent of Code][AoC] account, then use your browser development tools to retrieve the session cookie value. Store the value according to the `advent-of-code-data` instructions (either in `~/.config/aocd/token` or in the `AOC_SESSION` environment variable).\n\nSince this project uses poetry, I use [poetry-dotenv-plugin][] and I store the session cookie in a `.env` file in the root directory of this project:\n\n```sh\nAOC_SESSION=deadbeafdeadbeafdeadbeafdeadbeafdeadbeafdeadbeafdeadbeafdeadbeaf\n```\n\nDo make sure to restart the jupyter notebook server after updating this file.\n\n## 2015 and 2016 solutions\n\nThe 2015 and 2016 solutions are not IPython notebooks; they pre-date this repository, but were added later, and have not been updated or tested to work still. These don't use the `advent-of-code-data` library either so you need to download inputs manually for these.\n\nThey are included purely for completion's sake.\n\n## Rust solutions\n\nI'm trying out implementing solutions in Rust as well. I can't promise I'm going to keep this up or that I'll implement Rust versions of all solutions.\n\nI'm using the [cargo-aoc project](https://lib.rs/crates/cargo-aoc) as the runner; you'll need to run `cargo install cargo-aoc` to install it. Then, set your AoC credentials (`cargo aoc credentials -p ...`), move your working directory to a specific year (`cd rust/\u003cyear\u003e`, fetch inputs `cargo aoc input -y \u003cyear\u003e -d \u003cday\u003e` and you can run the solution for that day with `cargo aoc -d \u003cday\u003e`.\n\nLike with my Python solutions, I did not include my own puzzle inputs in the repository.\n\n## License\n\nSee the [LICENSE file](LICENSE) in the same directory.\n\n---\n\n[jupyter]: http://jupyter.org/\n[AoC]: https://adventofcode.com/\n[pydotorg]: https://python.org\n[github]: https://github.com/mjpieters/adventofcode/tree/master/\n[nbviewer]: https://nbviewer.jupyter.org/github/mjpieters/adventofcode/tree/master/\n[pipenv]: https://pipenv.readthedocs.io/\n[pipenv_install]: https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv\n[mplanimation]: https://matplotlib.org/api/animation_api.html\n[ffmpeg]: https://www.ffmpeg.org/\n[aocdata]: https://pypi.org/project/advent-of-code-data/\n[poetry-dotenv-plugin]: https://github.com/mpeteuil/poetry-dotenv-plugin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjpieters%2Fadventofcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjpieters%2Fadventofcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjpieters%2Fadventofcode/lists"}