{"id":18535777,"url":"https://github.com/daniel5151/aoc20","last_synced_at":"2025-05-15T00:30:39.230Z","repository":{"id":79235899,"uuid":"317614711","full_name":"daniel5151/aoc20","owner":"daniel5151","description":"My solutions to Advent of Code 2020 (in Rust)","archived":false,"fork":false,"pushed_at":"2021-12-02T20:40:59.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-17T07:32:36.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daniel5151.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-12-01T17:17:36.000Z","updated_at":"2021-12-02T20:41:02.000Z","dependencies_parsed_at":"2023-06-28T10:30:46.446Z","dependency_job_id":null,"html_url":"https://github.com/daniel5151/aoc20","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/daniel5151%2Faoc20","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel5151%2Faoc20/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel5151%2Faoc20/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel5151%2Faoc20/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel5151","download_url":"https://codeload.github.com/daniel5151/aoc20/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254250833,"owners_count":22039280,"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":[],"created_at":"2024-11-06T19:27:22.516Z","updated_at":"2025-05-15T00:30:39.207Z","avatar_url":"https://github.com/daniel5151.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of Code 2020\n\nMy solutions to Advent of Code 2020.\n\n- Last year: \u003chttps://github.com/daniel5151/aoc19\u003e\n\nSome goals:\n\n- Solve the questions (duh)\n- Keep the code clean (comments when applicable, using idiomatic Rust, etc...)\n- Solutions should have _reasonable_ (i.e: not strictly the _best_) space and time complexity\n- Solutions should run fairly quickly (on modern PCs)\n\nSome non-goals:\n\n- Scoring super high on the leaderboard (timezones give people an unfair advantage, and late-night-coding isn't prime-time for me)\n\n[Last year](https://github.com/daniel5151/aoc19) I did end up racing for a leaderboard spot, but unfortunately, I'm back on the east coast this year, and I am _definitely_ not frosty and ready to race at midnight.\n\n## Running\n\n(Assuming that the desired day's input has already been downloaded)\n\n```bash\ncargo run --release --features extras -- \u003cday\u003e \u003cquestion\u003e\n```\n\nTests can be run using the standard `cargo test` flow.\n\n```bash\ncargo test -- dayX # only runs tests for the particular day\n```\n\n## Running (when solving the day of)\n\n```bash\n./aoc19.sh \u003cday\u003e \u003cquestion\u003e\n# e.g: ./aoc19 3 1\n```\n\nThe harness will automatically download question input if a `cookie.txt` is provided. It's contents should look something like this:\n\n```\nsession=53616c...\n```\n\nGetting this cookie is fairly straightforward:\n- Open Chrome\n- Navigate to _any_ day's input URL (e.g: https://adventofcode.com/2020/day/1/input)\n- Open the Chrome Network Inspector\n- Refresh the URL\n- Right click the `input` request, and \"copy \u003e copy as cURL\"\n    - the string should include a `-H 'cookie: \u003ccookie.txt\u003e'` component.\n\nAlternatively, you can just invoke `cargo run --release -- \u003cday\u003e \u003cquestion\u003e` manually, though it will not automatically download input data.\n\n## Q: Why use a macro to parse input?\n\nSpeed!\n\nIf I'd used a function, I'd have to explicitly specify the return type (e.g\n`HashMap\u003cusize, Vec\u003c(usize, usize)\u003e\u003e` or what have you).\n\n\u003e Okay, so why not just use a closure then? That'll infer the types for you!\n\nYeah, sure, but then error handling would be more annoying, since the return\nvalue would have to be wrapped with `Ok()`.\n\nSo yeah, it's a bit weird, but there is a method to the madness.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel5151%2Faoc20","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel5151%2Faoc20","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel5151%2Faoc20/lists"}