{"id":18855384,"url":"https://github.com/cak/advent-of-code","last_synced_at":"2026-02-05T22:30:21.324Z","repository":{"id":260071433,"uuid":"873494728","full_name":"cak/advent-of-code","owner":"cak","description":"Python solutions for Advent of Code challenges, organized by year.","archived":false,"fork":false,"pushed_at":"2024-12-08T10:10:38.000Z","size":98,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T18:44:59.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/cak.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":"2024-10-16T09:08:50.000Z","updated_at":"2024-12-08T10:10:42.000Z","dependencies_parsed_at":"2024-11-29T11:25:42.869Z","dependency_job_id":"0fd3a42f-bf58-4007-9e1f-1efed1851c0d","html_url":"https://github.com/cak/advent-of-code","commit_stats":null,"previous_names":["cak/advent-of-code"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cak%2Fadvent-of-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cak%2Fadvent-of-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cak%2Fadvent-of-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cak%2Fadvent-of-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cak","download_url":"https://codeload.github.com/cak/advent-of-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239793065,"owners_count":19697893,"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-08T03:53:48.297Z","updated_at":"2026-02-05T22:30:21.214Z","avatar_url":"https://github.com/cak.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎄 Advent of Code 🎄\n\nWelcome to my festive repository, where code meets Christmas cheer! This collection holds my solutions for the [Advent of Code](https://adventofcode.com/) puzzles across multiple years. Join me as we unwrap new challenges each day of December, guided by the merry elves and sprinkled with holiday magic! ✨\n\n## 📅 Advent of Code 2024 Progress (Goal: 20 Stars ⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐)\n\n### ⭐ Progress: 4/50 ⭐\n\n| Day                                        | Stars | Solution                                                                           |\n| ------------------------------------------ | ----- | ---------------------------------------------------------------------------------- |\n| [01](https://adventofcode.com/2024/day/1)  | ⭐⭐  | [Solution](https://github.com/cak/advent-of-code/blob/main/2024/day01/solution.py) |\n| [02](https://adventofcode.com/2024/day/2)  | ⭐⭐  | [Solution](https://github.com/cak/advent-of-code/blob/main/2024/day02/solution.py) |\n| [03](https://adventofcode.com/2024/day/3)  |       |                                                                                    |\n| [04](https://adventofcode.com/2024/day/4)  |       |                                                                                    |\n| [05](https://adventofcode.com/2024/day/5)  |       |                                                                                    |\n| [06](https://adventofcode.com/2024/day/6)  |       |                                                                                    |\n| [07](https://adventofcode.com/2024/day/7)  |       |                                                                                    |\n| [08](https://adventofcode.com/2024/day/8)  |       |                                                                                    |\n| [09](https://adventofcode.com/2024/day/9)  |       |                                                                                    |\n| [10](https://adventofcode.com/2024/day/10) |       |                                                                                    |\n| [11](https://adventofcode.com/2024/day/11) |       |                                                                                    |\n| [12](https://adventofcode.com/2024/day/12) |       |                                                                                    |\n| [13](https://adventofcode.com/2024/day/13) |       |                                                                                    |\n| [14](https://adventofcode.com/2024/day/14) |       |                                                                                    |\n| [15](https://adventofcode.com/2024/day/15) |       |                                                                                    |\n| [16](https://adventofcode.com/2024/day/16) |       |                                                                                    |\n| [17](https://adventofcode.com/2024/day/17) |       |                                                                                    |\n| [18](https://adventofcode.com/2024/day/18) |       |                                                                                    |\n| [19](https://adventofcode.com/2024/day/19) |       |                                                                                    |\n| [20](https://adventofcode.com/2024/day/20) |       |                                                                                    |\n| [21](https://adventofcode.com/2024/day/21) |       |                                                                                    |\n| [22](https://adventofcode.com/2024/day/22) |       |                                                                                    |\n| [23](https://adventofcode.com/2024/day/23) |       |                                                                                    |\n| [24](https://adventofcode.com/2024/day/24) |       |                                                                                    |\n| [25](https://adventofcode.com/2024/day/25) |       |                                                                                    |\n\n---\n\n### 🎯 Goal Tracker: Earn 20 Stars\n\n| Milestone       | Stars Earned | Status         |\n| --------------- | ------------ | -------------- |\n| 1-10 Stars      | 4/10         | 🟩 On Track    |\n| 11-20 Stars     | 0/10         | 🟦 Not Started |\n| Full Completion | 4/50         | ⬜             |\n\n## 🎄 Folder Structure\n\nOur repository is structured like a well-organized Christmas workshop! Each year contains folders for individual days, and the `elf` package houses utilities for puzzle-solving and automation:\n\n```bash\nadvent-of-code/\n├── 2016/\n│   ├── day01/\n│       ├── solution.py              # 🎁 Your main solution script for the day\n│       ├── input.txt                # 📜 The puzzle input for the day\n│       ├── test_input.txt           # 🧪 Example input for testing your solution\n│       ├── expected_output.txt      # ✅ The expected output for test input\n├── elf/                             # 🧝‍♂️ The elves' magical helpers!\n│   ├── cli/                         # 🎅 Command-line interface for automation\n│       ├── create_day.py            # 🏗️ Script to create new day folders\n│       ├── fetch_input.py           # 🔄 Script to fetch puzzle inputs\n│       ├── run.py                   # 🚀 Script to run a day's solution\n│       ├── submit.py                # 🎯 Script to submit answers to Advent of Code\n│       ├── test.py                  # 🧪 Script to test solutions for correctness\n│   ├── templates/                   # ✨ Templates for new solution files\n│       ├── args.py                  # ⚙️ Argument parsing template for solutions\n│       ├── solution_template.py     # 📝 Template for daily solution scripts\n│   ├── utils.py                     # 🧰 General utility functions for helpers\n│   ├── input.py                     # 🔄 Functions to fetch and cache puzzle inputs\n│   ├── config.py                    # ⚙️ Configuration settings for the project\n│   ├── testing.py                   # 🧪 Tools for testing solutions\n│   ├── answer.py                    # 🎯 Helpers for answer validation and submission\n│   └── exceptions.py                # 🚨 Custom exception handling for the CLI\n├── README.md                        # 📖 Documentation (you're here!)\n├── LICENSE                          # 📜 Open source license\n├── pyproject.toml                   # 📦 Project dependencies and settings\n├── uv.lock                          # 🔒 Dependency lockfile\n```\n\n## 🛠️ Automating Tasks with the Elf CLI\n\nThe `elf` CLI is your all-in-one tool to manage Advent of Code puzzles. From creating folders to running tests, it makes solving puzzles joyful!\n\n### Installing Dependencies\n\nBefore you start, install the required dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\n### Commands Overview\n\nRun the CLI by executing:\n\n```bash\npython -m elf.cli.main \u003ccommand\u003e [options]\n```\n\nAvailable commands:\n\n- **`create-day`**: Create a new folder for a specific day.\n- **`fetch-input`**: Fetch puzzle input for a specific day.\n- **`run`**: Run the solution for a specific day and part.\n- **`test`**: Test the solution using provided test inputs.\n- **`submit`**: Submit your solution to Advent of Code.\n\n### Command Details\n\n#### 1. Create a New Day Folder\n\nSet up a new folder for a day, complete with templates and input files:\n\n```bash\npython -m elf.cli.main create-day \u003cyear\u003e \u003cday\u003e --output-dir \u003cdirectory\u003e\n```\n\nExample:\n\n```bash\npython -m elf.cli.main create-day 2016 5\n```\n\n#### 2. Fetch Puzzle Input\n\nFetch your personalized input for a day:\n\n```bash\npython -m elf.cli.main fetch-input \u003cyear\u003e \u003cday\u003e\n```\n\nExample:\n\n```bash\npython -m elf.cli.main fetch-input 2016 5\n```\n\n#### 3. Run a Solution\n\nRun your solution for a specific day and part:\n\n```bash\npython -m elf.cli.main run \u003cyear\u003e \u003cday\u003e --part \u003c1|2|both\u003e\n```\n\nExamples:\n\n```bash\npython -m elf.cli.main run 2016 4 --part 1\npython -m elf.cli.main run 2016 4 --part both\n```\n\n#### 4. Test Your Solution\n\nRun tests using `test_input.txt` and `expected_output.txt`:\n\n```bash\npython -m elf.cli.main test \u003cyear\u003e \u003cday\u003e\n```\n\nExample:\n\n```bash\npython -m elf.cli.main test 2016 4\n```\n\n#### 5. Submit Your Answer\n\nSubmit your solution directly to Advent of Code:\n\n```bash\npython -m elf.cli.main submit \u003cyear\u003e \u003cday\u003e \u003cpart\u003e \u003canswer\u003e\n```\n\nExample:\n\n```bash\npython -m elf.cli.main submit 2016 4 1 12345\n```\n\n### Setting Up Your Session Token\n\nTo fetch inputs and submit answers, you'll need your Advent of Code session token:\n\n1. Log in to [Advent of Code](https://adventofcode.com/) and copy your session token from the browser cookies.\n2. Save it as an environment variable:\n   ```bash\n   export AOC_SESSION_COOKIE='your_session_token_here'\n   ```\n\n**Note**: Keep your token secret to prevent unauthorized access.\n\n## ✨ Features of the `elf` Package\n\nThe `elf` package simplifies common tasks:\n\n- **Input Handling**: Automatically fetch and cache puzzle inputs.\n- **Testing Utilities**: Compare your output with expected results.\n- **Template Management**: Quickly create new solution files.\n- **Error Handling**: Gracefully manage exceptions.\n\nExample usage in a solution:\n\n```python\nfrom elf import input, utils\n\ndef part1(data):\n    return sum(map(int, data.split()))\n\nif __name__ == \"__main__\":\n    data = input.read_input_file(\"input.txt\")\n    print(\"Part 1:\", part1(data))\n```\n\n---\n\n**May your Advent of Code journey be merry and bright! Happy coding! 🎅**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcak%2Fadvent-of-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcak%2Fadvent-of-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcak%2Fadvent-of-code/lists"}