-
Clone the repository
git clone https://github.com/ShubhamVerma1811/advent-of-code.git cd advent-of-code -
Run the setup script
pnpm install pnpm setup
This will:
- Create necessary directories
- Set up a
.envfile with instructions - Print next steps
-
Get your session cookie
- Log in to Advent of Code
- Open browser developer tools (F12) → Network tab
- Refresh the page
- Find any request to adventofcode.com and copy the
sessioncookie - Paste it in the
.envfile:AOC_COOKIE=your_session_cookie_here
# Clean any existing solutions (optional)
pnpm clean
# Generate files for today's puzzle
pnpm gen
# Or specify day and year
pnpm gen <day> <year>
# Example: pnpm gen 1 2023This will:
- Create a new directory at
src/<year>/day-<day> - Generate template files for TypeScript and Go
- Create test files with sample input
- Download your puzzle input to
data/<year>-<day>.txt
pnpm formatTo update your AoC stats in the README:
pnpm update-statsYou can add support for additional programming languages by following these steps:
- Create a new directory under
templates/day/for your language (e.g.,python/) - Add your template files in that directory
- Update
scripts/generate.jsto include your language in thereplacementsobject:const replacements = { // ... existing entries "your-language/your-template-file": values, };
- The script will automatically replace any
{{DAY}}and{{YEAR}}placeholders in your template files - Make sure to update the
copyfunction if your language requires any special file handling
For example, to add Python support:
-
Create
templates/day/python/solution.pywith your Python template -
Add the following to the replacements object in
generate.js:'python/solution.py': values,
-
Format your code
pnpm format
-
Clean up (if needed)
pnpm clean # Removes everything in the src directory
Total stars: 29
| Day | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ⭐⭐ | ⭐⭐ | ⭐⭐ | |||||||
| 2 | ⭐⭐ | ⭐⭐ | ⭐⭐ | |||||||
| 3 | ⭐⭐ | ⭐⭐ | ||||||||
| 4 | ⭐⭐ | ⭐⭐ | ⭐⭐ | |||||||
| 5 | ⭐ | ⭐⭐ | ||||||||
| 6 | ⭐⭐ | ⭐ | ||||||||
| 7 | ||||||||||
| 8 | ⭐ | |||||||||
| 9 | ||||||||||
| 10 | ||||||||||
| 11 | ||||||||||
| 12 | ||||||||||
| 13 | ||||||||||
| 14 | ||||||||||
| 15 | ||||||||||
| 16 | ||||||||||
| 17 | ||||||||||
| 18 | ||||||||||
| 19 | ||||||||||
| 20 | ||||||||||
| 21 | ||||||||||
| 22 | ||||||||||
| 23 | ||||||||||
| 24 | ||||||||||
| 25 | ||||||||||
| Total: | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 11 |