{"id":16587765,"url":"https://github.com/meanderingprogrammer/advent-of-code","last_synced_at":"2025-10-29T08:33:19.149Z","repository":{"id":64246873,"uuid":"351253177","full_name":"MeanderingProgrammer/advent-of-code","owner":"MeanderingProgrammer","description":"Advent of Code - All Years - Blazingly Fast","archived":false,"fork":false,"pushed_at":"2025-10-18T19:36:42.000Z","size":5995,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-18T23:17:51.170Z","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","advent-of-code-2024","go","ocaml","python","rust","zig"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/MeanderingProgrammer.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-24T23:38:18.000Z","updated_at":"2025-10-18T19:36:47.000Z","dependencies_parsed_at":"2024-02-06T00:31:23.782Z","dependency_job_id":"a7140da3-ee8c-4ddd-99a7-017c64acf469","html_url":"https://github.com/MeanderingProgrammer/advent-of-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MeanderingProgrammer/advent-of-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeanderingProgrammer%2Fadvent-of-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeanderingProgrammer%2Fadvent-of-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeanderingProgrammer%2Fadvent-of-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeanderingProgrammer%2Fadvent-of-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MeanderingProgrammer","download_url":"https://codeload.github.com/MeanderingProgrammer/advent-of-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeanderingProgrammer%2Fadvent-of-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281588610,"owners_count":26526996,"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","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","advent-of-code-2024","go","ocaml","python","rust","zig"],"created_at":"2024-10-11T22:54:58.903Z","updated_at":"2025-10-29T08:33:17.384Z","avatar_url":"https://github.com/MeanderingProgrammer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of Code\n\nAll Years - Blazingly Fast\n\n![Years Completed](https://github.com/MeanderingProgrammer/advent-of-code-images/blob/main/advent-completed.png)\n\n# Runtimes\n\n![Runtimes](https://github.com/MeanderingProgrammer/advent-of-code-images/blob/main/year_percentage.png)\n\n# History\n\nWhen I first started Advent in 2020 I wrote everything in `Python` for simplicity\nas well as getting better at my main scripting language.\n\nI then decided to go back and solve all the years from 2015 on also in `Python`.\n\nSince then I have used Advent as an opportunity to learn new languages.\n\nSo far this has been:\n\n- 2021: [Go](https://go.dev/)\n- 2022: [Rust](https://www.rust-lang.org/)\n- 2023: [OCaml](https://ocaml.org/)\n- 2024: [Zig](https://ziglang.org/)\n\nSometime after 2022 I decided to go back and optimize every solution with the goal\nof having no single solution take more than 1 second to run. Sometimes this involves\nalgorithm improvements, other times I decided to re-write solutions from `Python`\ninto something like `Rust` or `Go`. Currently the slowest solution takes just under\n250 ms, so mission accomplished. Now the total runtime is such that each year takes\nless than  1 second!\n\n# Input Data\n\n\u003cdetails\u003e\n\n\u003csummary\u003eThe input for each puzzle is in a separate private Github repo\u003c/summary\u003e\n\nThis is done to comply with the policy [here](https://adventofcode.com/about).\n\nThese inputs end up in the `data` folder in the same structure as the solutions.\n\nFor instance the input for year `2020` day `5` is file `data/2020/05/data.txt`.\n\nAfter cloning this repo the following command needs to be run to get the data.\n\n```bash\ngit submodule update --init\n```\n\nThis also means when pulling changes the `update` command must also be ran.\n\n```bash\ngit submodule update\n```\n\n\u003c/details\u003e\n\n# Setup\n\n## Install Requirements\n\n```bash\npip install -r scripts/requirements.txt\n```\n\n## Set Aliases\n\n```bash\nalias a-build=\"./scripts/advent.py build\"\nalias a-run=\"./scripts/advent.py run\"\nalias a-gen=\"./scripts/advent.py generate\"\nalias a-graph=\"./scripts/advent.py graph\"\n```\n\n# Build\n\nThe `build` target is used to do any language specific setup prior to running.\n\nThis includes downloading any necessary libraries, compiling targets, etc.\n\nNone of the parameters are required, the default behavior in this case is to\nbuild and test all supported languages.\n\n- Alias Command: `a-build`\n- Direct Command: `./scripts/advent.py build`\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUsage\u003c/summary\u003e\n\n```bash\na-build \\\n  (--language \u003clanguage\u003e)* \\\n  --info?\n```\n\n| Variable Name | Alt  | Description                            | Default | Example   |\n| ------------- | ---- | -------------------------------------- | ------- | --------- |\n| language      | `-l` | Limit build to the specified languages | None    | `-l rust` |\n| info          | `-i` | Outputs which languages will be built  | `False` | `-i`      |\n\n\u003c/details\u003e\n\n# Run\n\nThe `run` target is used to run various days rather than running directly.\n\nDoes some hacky stuff to set arguments and run commands, but for the most part runs\nstandard build commands for each language / framework.\n\nNone of the parameters are required, the default behavior in this case is to run\nthe latest day in the fastest language it is implemented in.\n\n- Alias Command: `a-run`\n- Direct Command: `./scripts/advent.py run`\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUsage\u003c/summary\u003e\n\n```bash\na-run \\\n  --template \u003ctemplate\u003e? \\\n  (--year \u003cyear\u003e)* \\\n  (--day \u003cday\u003e)* \\\n  (--language \u003clanguage\u003e)* \\\n  --strategy \u003cstrategy\u003e? \\\n  --slow \u003ctime\u003e? \\\n  --test? \\\n  --info?\n```\n\n| Variable Name | Alt  | Description                             | Default  | Example           |\n| ------------- | ---- | --------------------------------------- | -------- | ----------------- |\n| template      | `-t` | Name that targets specific years / days | `latest` | `-t languages`    |\n| year          | `-y` | List of years to run                    | None     | `-y 2021 -y 2022` |\n| day           | `-d` | List of days to run                     | None     | `-d 1 -d 3 -d 5`  |\n| language      | `-l` | Limit runs to the specified languages   | None     | `-l go`           |\n| strategy      | `-s` | A way to select which languages to run  | None     | `-s fastest`      |\n| slow          | `-S` | Defines the runtime (in ms) for slow    | 100      | `-S 500`          |\n| test          | `-T` | Passes test flag to each day            | `False`  | `-T`              |\n| info          | `-i` | Outputs which days would run            | `False`  | `-i`              |\n\n- If `template` is provided then `year` \u0026 `day` must not be provided\n- If `year` or `day` are provided then `template` must not be provided\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eProcess Runtime Output\u003c/summary\u003e\n\n```bash\ncat all.json | jq -r '.[]|[.year, .day, .language, .runtime]|@tsv'\ncat all.json | jq -r '.[]|[.year, .day, .language, .runtime]|@tsv' | sort -nk4\ncat all.json | jq -r '.[]|[.year, .day, .language, .runtime]|@tsv' | sort -nk4 | awk '{ if ($4 \u003e 100) { print $0 } }'\ncat all.json | jq -r '.[]|select(.year == 2015 and .day == 24)'\ncat all.json | jq -r '.[]|.runtime' | awk '{ sum+=$1 } END { print sum, \"ms\" }'\ncat all.json | jq -r '.[]|select(.year == 2015)|.runtime' | awk '{ sum+=$1 } END { print sum, \"ms\" }'\ncat all.json | jq -r '.[]|[.year, .runtime]|@tsv' | awk '{ years[$1] += $2 } END { for (year in years) { print year, years[year], \"ms\" } }'\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUnit Test\u003c/summary\u003e\n\nThis will test that some shared logic works across usage days. Such as the `int-code`\nimplementation from 2019.\n\n```bash\npytest -s scripts\n```\n\n\u003c/details\u003e\n\n# Generate\n\nThe `generate` target creates initial files and empty data file for the specified\nlanguage.\n\nWill do any other required setup, such as updating `Cargo.toml` for `rust`.\n\nWill pull down your puzzle input if [instructions](#install-aoc-cli) are followed.\n\nNone of the parameters are required, the default behavior in this case is to generate\nthe next day using the rust template.\n\n- Alias Command: `a-gen`\n- Direct Command: `./scripts/advent.py generate`\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUsage\u003c/summary\u003e\n\n```bash\na-gen \\\n  --template \u003ctemplate\u003e? \\\n  --year \u003cyear\u003e? \\\n  --day \u003cday\u003e? \\\n  --language \u003clanguage\u003e? \\\n  --puzzle? \\\n  --info?\n```\n\n| Variable Name | Alt  | Description                             | Default | Example     |\n| ------------- | ---- | --------------------------------------- | ------- | ----------- |\n| template      | `-t` | Name that targets specific year / day   | `next`  | `-t next`   |\n| year          | `-y` | Year to generate starting files for     | None    | `-y 2022`   |\n| day           | `-d` | Day to generate starting files for      | None    | `-d 5`      |\n| language      | `-l` | Language to generate starting files for | `rust`  | `-l python` |\n| puzzle        | `-p` | Download puzzle description as well     | `False` | `-p`        |\n| info          | `-i` | Outputs which day would get generated   | `False` | `-i`        |\n\n- If `template` is provided then `year` \u0026 `day` must not be provided\n- If `year` or `day` are provided then `template` must not be provided\n\n\u003c/details\u003e\n\n## Install aoc-cli\n\nTemplate generation script can use `aoc-cli` to download input: [docs](https://github.com/scarvalhojr/aoc-cli).\n\nFollow the instructions in the `README` of `aoc-cli` to get your session cookie setup.\n\nThis library relies on openssl which you will also need to install if you don't already\nhave it.\n\n```bash\ncargo install aoc-cli\ntouch .adventofcode.session\n```\n\n# Graph\n\nThe `graph` target creates a variety of graphs to visualize the runtime of days split\nand grouped on different dimensions.\n\nNone of the parameters are required, the default behavior in this case is to create\nonly new graphs and skip graphs that have been created before.\n\n- Alias Command: `a-graph`\n- Direct Command: `./scripts/advent.py graph`\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUsage\u003c/summary\u003e\n\n```bash\na-graph \\\n  --archive? \\\n  --info?\n```\n\n| Variable Name | Alt  | Description                             | Default | Example |\n| ------------- | ---- | --------------------------------------- | ------- | ------- |\n| archive       | `-a` | Archive existing graphs                 | `False` | `-a`    |\n| info          | `-i` | Outputs whether graphs would be arhived | `False` | `-i`    |\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeanderingprogrammer%2Fadvent-of-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeanderingprogrammer%2Fadvent-of-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeanderingprogrammer%2Fadvent-of-code/lists"}