Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p7g/advent-of-code
My solutions to Advent of Code
https://github.com/p7g/advent-of-code
advent-of-code
Last synced: 6 days ago
JSON representation
My solutions to Advent of Code
- Host: GitHub
- URL: https://github.com/p7g/advent-of-code
- Owner: p7g
- Created: 2020-11-22T17:13:26.000Z (almost 4 years ago)
- Default Branch: 2023
- Last Pushed: 2023-12-25T05:22:39.000Z (11 months ago)
- Last Synced: 2023-12-26T03:55:16.885Z (11 months ago)
- Topics: advent-of-code
- Language: Python
- Homepage:
- Size: 374 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advent of code solutions
This branch has solutions for 2023, for other years see the other branches:
- [2022](https://github.com/p7g/advent-of-code/tree/2022)
- [2021](https://github.com/p7g/advent-of-code/tree/2021)
- [2020](https://github.com/p7g/advent-of-code/tree/2020)
- [2019](https://github.com/p7g/advent-of-code/tree/2019)## Instructions if you wanna use aoc.py
1. Set up a Python virtual environment and install the dependencies with `python -m pip install -r requirements.txt`
2. Grab the cookie named "session" from adventofcode.com after you've signed in and put that in a file called .aoc-session
3. Name your solution files like 01.py (zero-padded to 2 digits)
4. Optionally `from aoc import *` in your solutions to import the prelude
5. Either run the solutions directly (i.e. `python 01.py`) or just run `./aoc.py` and it will run today's solutionThe input for the problem (a str) can be found in the `data` member of the `aoc` module. The input is cached so it's only requested once per day.
To manually specify which solution to run and the input to use, use the `AOC_YEAR` and `AOC_DAY` environment variables.