{"id":20850415,"url":"https://github.com/noteed/adventofcode-2023","last_synced_at":"2025-03-12T12:25:43.009Z","repository":{"id":210396246,"uuid":"726183269","full_name":"noteed/adventofcode-2023","owner":"noteed","description":"Learning Rust I guess","archived":false,"fork":false,"pushed_at":"2024-04-10T08:12:56.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-19T06:11:32.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/noteed.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}},"created_at":"2023-12-01T18:00:04.000Z","updated_at":"2023-12-01T18:00:33.000Z","dependencies_parsed_at":"2023-12-10T20:46:00.586Z","dependency_job_id":null,"html_url":"https://github.com/noteed/adventofcode-2023","commit_stats":null,"previous_names":["noteed/adventofcode-2023"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fadventofcode-2023","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fadventofcode-2023/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fadventofcode-2023/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fadventofcode-2023/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noteed","download_url":"https://codeload.github.com/noteed/adventofcode-2023/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243216096,"owners_count":20255314,"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-18T03:09:20.693Z","updated_at":"2025-03-12T12:25:42.984Z","avatar_url":"https://github.com/noteed.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of code 2023\n\nSee [adventofcode.com/2023](https://adventofcode.com/2023). The site uses some\nOAuth providers for authentication (to see the puzzle descriptions and submit\nsolutions). Puzzle description page URLs look like\n[adventofcode.com/2023/day/1](https://adventofcode.com/2023/day/1).\n\n# Day 1\n\n```\n$ cd day/1\n$ nix-shell -p cargo\n$ cargo new solve # But this was renamed, see below.\n$ cargo ./input.txt\n...\nSum: 52834\n$ rm -r .git\n```\n\nI could have used `cargo new --vcs none solve` to prevent the creation of the\n`.git/` directory.\n\nI've created a `day/1/solve/` directory structure, but I should have used\n`day/1/` instead (same for the following days). The puzzle input files are\noutside of `solve/` (i.e. `day/1/input.txt` for instance).\n\nWhen implementing the `multicall` binary (see below after Day 10), I've removed\nthe `solve/` subdirectory, and renamed the package name from \"solve\" to \"day1\"\nin the `Cargo.toml` file.\n\nEach participant receive their own input, so it's ok to publish the results.\n(And keeping them here helps during refactoring.)\n\nIn addition of `input.txt`, there is also a shorter `example.txt` file.\n\n# Day 2\n\nIt seems I need rustc 1.61 (the above provided 1.60) to build `nom` 7.1.3. So\nI've updated my nixos-unstable channel. (It's possible my stable channel is\nquite old too.) This brings me to rustc 1.73.\n\n```\n$ cd day/2\n$ nix-shell -I nixpkgs=channel:nixos-unstable -p cargo\n```\n\n```\n$ cargo run ./input.txt\n...\nSum: 2176\nSum of powers: 63700\n```\n\n# Day 3\n\n```\n$ cargo run ./input.txt\n...\nPart one: 525181\nPart two: 84289137\n```\n\n# Day 4\n\n```\n$ cargo run ./input.txt\n...\nPart two: 14624680\n```\n\n# Day 5\n\nUse\n\n```\n$ time cargo run --release ./input.txt\n...\nPart one: Some(322500873)\nPart two: 108956227\nreal    1m46.364s\nuser    1m46.349s\nsys     0m0.012s\n```\n\n(Part one is available much earlier.)\n\nI guess that instead of resolving individual numbers (seeds), I should resolve\nranges. So that after each \"stage\", the output is one (best case) or multiple\nranges. And before proceeding to next stage, ranges that are \"compaptible\"\ncould be merged together.\n\n# Day 6\n\nFor part two, I simply changed the `input.txt` file manually.\n\n```\n$ cargo run ./input-part-1.txt\n...\nPart one: 24655068\n```\n\n```\n$ cargo run ./input.txt\n...\nPart one: 24655068\n```\n\n# Day 7\n\nThe code corresponds to part two. Part one is commented out/changed.\n\n```\n$ cargo run ./input.txt\n...\nPart one: 251824095\n```\n\n# Day 8\n\n```\n$ cargo run ./input.txt\n...\nPart one: 16409\n[\"QXA\", \"PDA\", \"TDA\", \"QQA\", \"PPA\", \"AAA\"]\nQXA: 12643\nPDA: 14257\nTDA: 15871\nQQA: 18023\nPPA: 19637\nAAA: 16409\nPart two: 11795205644011\n```\n\n# Day 9\n\n```\n$ cargo run ./input.txt\n...\nPart two: 1112\n```\n\n# Day 10\n\n```\n$ cargo run --release ./input.txt\n...\nPart one: 6599\n```\n\nI havn't made part 2.\n\n\n# Multi-calls\n\nA binary to run all puzzles is given too.\n\n```\n$ cargo new --vcs none multicall\n$ cargo run -- --day 1 ../day/1/input.txt\n...\nSum: 52834\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoteed%2Fadventofcode-2023","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoteed%2Fadventofcode-2023","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoteed%2Fadventofcode-2023/lists"}