advent-of-code/2019-python
Anders Englöf Ytterström 40274ea044 Solve 2019:14 "Space Stoichiometry"
Got stuck completely at part 1. Last 2 examples
did not add up, off by 100 ore.

I did know that I had to count by overflows somehow,
but I could not manage it. After countless hours
writing a verbose debugger, I wiped the whole thing
and looked at this code for inspiration:

https://github.com/sophiebits/adventofcode/blob/master/2019/day14.py

It works by using modulus and removing all keys
in a dict except ORE.
2023-12-29 00:36:55 +01:00
..
output Solve 2019:14 "Space Stoichiometry" 2023-12-29 00:36:55 +01:00
.gitignore Initiate AoC 2019 in python 2023-12-19 14:51:11 +01:00
aoc.py Lint and Refactor day 1-11 2023-12-19 18:34:03 +01:00
README.md Initiate AoC 2019 in python 2023-12-19 14:51:11 +01:00

Advent of Code 2019

Solutions for #aoc2019 in Python 3 (3.11.5).

Help scripts

Display all solved puzzles:

python aoc.py

To bootstrap a new puzzle (creates input/<day_no>.txt and output/day_<day_no>.py):

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

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

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

python -m output.day_XX

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

xclip -selection clipboard -o | python -m output.day_XX
cat tmpfile | python -m output.day_XX

Execute separate puzzle on file save (replace XX with the puzzle number):

ls output/*.py | entr -c -s 'xclip -selection clipboard -o | python -m output.day_XX'
ls output/*.py | entr -c -s 'cat tmpfile | python -m output.day_XX'
ls output/*.py | entr -c -r python -m output.day_XX

(requires entr and xclip, Mac users can instead use pbpaste)