Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gereleth/adventofcode2022
My python solutions to AdventOfCode 2022 tasks
https://github.com/gereleth/adventofcode2022
advent-of-code advent-of-code-2022 animation matplotlib matplotlib-animation python visualization
Last synced: 4 days ago
JSON representation
My python solutions to AdventOfCode 2022 tasks
- Host: GitHub
- URL: https://github.com/gereleth/adventofcode2022
- Owner: gereleth
- Created: 2022-12-22T21:07:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T13:34:07.000Z (almost 2 years ago)
- Last Synced: 2024-11-05T13:46:44.886Z (about 2 months ago)
- Topics: advent-of-code, advent-of-code-2022, animation, matplotlib, matplotlib-animation, python, visualization
- Language: Python
- Homepage:
- Size: 1020 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Advent of Code 2022
My python solutions for all days of [Advent Of Code 2022](https://adventofcode.com/2022).
## Prerequisites
I ran this code on python 3.10.8. It might work on other python 3 versions too.
Create a virtual environment and install dependencies.
```
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```## Layout
Code for each day is in `src/day{i}.py`.
Inputs for each day are in `inputs/day{i}/test.txt` and `inputs/day{i}/task.txt`.
## Usage
Solve all tasks:
```bash
python src/solve.py
```Solve particular day:
```bash
python src/solve.py --day {day}
```Other options:
- `--test` - run on test input
- `--day {day} --input {filepath}` - run on a specified input file## Animations
Some days include code to produce matplotlib animations illustrating the solution.
You can see them by running
```bash
python src/dayX.py
```
Day 8
Day 9
Day 10
Day 12
Day 14
Day 22
Day 24
## Solve times
Solve times from a single run on my computer. Available also as a [csv file](outputs/time_stats.csv).
![Solve times horizontal bar chart](outputs/time_stats.png)