Skip to content

lancelote/advent_of_code

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

advent_of_code

Advent of code — Programming Christmas Puzzles

★ - both the first and the second parts are solved

☆ - only the first part is solved

  • 2015 - ★★★★★ ★★
  • 2016 - ★★★★★ ★★
  • 2017 - ★★★★★ ★★★★★ ★★
  • 2018 - ★★★★★ ★★★★★ ★★
  • 2019 - ★★★★★ ★★★★★ ★★★
  • 2020 - ★★★★★ ★★★★★ ★★★★★ ☆
  • 2021 - ★★★★★ ★★★★★ ★★★★★ ★★★
  • 2022 - ★★★★★ ★★★★★ ★★★★★ ★

How to use

To launch the Puzzle Solver on 2017 year day 5 part “A” puzzle:

python main.py solve 2017 5 a

Requirements

Solver uses advent-of-code-data to fetch tasks from the server. You need to set up a token for it to work. See the instruction.

I use Python 3.11 for development. The code should work fine with older versions.

To install requirements (virtual environment is recommended)

python -m pip install -r requirements-dev.txt

To update requirements.txt with the newest package versions

pur -r requirements.txt

Tests

I store all the tests in tests folder and use pytest as a test runner

python -m pytest tests

Linters

mypy, flake8, black, and reorder-python-imports are used in pre-commit hook. To run linters

pre-commit install
pre-commit run --all-files

Merry Christmas and Happy New Year!