Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)