advent-of-code/2021-python
Anders Ytterström 811d2cb224 Solve 2021:8 "Seven Segment Search"
For part 1, it took way longer than necessary since I read the
instructions over and over again. Gotta love AOC WOT.

Part 2 was a PITA. I got stuck at the last 2 examples since I at the
time did not find any clever way to determine which of the 2 outputs for
'1' mapped to c and f.

Since I already spent far too much time and effort, a try/except with
ValueError (digits.index will fail if c and f are flipped wrong) will do
for now.

There is probably a more efficient and smart way to do this.
2021-12-08 11:35:18 +01:00
..
solutions Solve 2021:8 "Seven Segment Search" 2021-12-08 11:35:18 +01:00
tests Solve 2021:8 "Seven Segment Search" 2021-12-08 11:35:18 +01:00
.gitignore 🔧 Setup Advent of Code 2021 2021-10-22 17:17:55 +02:00
.python-version 🔧 Setup Advent of Code 2021 2021-10-22 17:17:55 +02:00
aoc.py 🔧 Setup Advent of Code 2021 2021-10-22 17:17:55 +02:00
README.md 🔧 Setup Advent of Code 2021 2021-10-22 17:17:55 +02:00

Advent of Code 2021

Solutions for #aoc2020 in Python 3 (3.8+).

Help scripts

Solve all puzzles:

python aoc.py

To bootstrap a new puzzle (creates inputs/<day_no>.txt, solutions/day_<day_no>.py och tests/test_day_<day_no>.py):

python aoc.py <dag_no> "<puzzle_name>"

Manually copy the puzzle input from https://adventofcode.com and paste it in inputs/<day_no>.txt to start coding.

Solve separate puzzle (replace XX with the puzzle number):

python -m solutions.day_XX

Run tests (replace XX with the puzzle number):

python -m unittest --locals -v
# or, if `pytest` is preferred:
pytest