Joining the Advent of Code this year. Deciced to write everything in Python to learn more/challenge myself.
For each day, I'll add an directory, called dayXX, with the following files:
- day.py (The class/module to import and run)
- input.txt (My personal input)
- example.txt (Example data)
Using AdventOfCode.py, which will take care of the reading the input for each day, I'm able to solve (the parts of the) puzzle of all the different days.
Run all:
./AdventOfCode.py
Run day 1 (both, part 1 and 2):
./AdventOfCode.py 1
Run day 1, only part 1:
./AdventOfCode.py 1 1
Run day 1, only part 2:
./AdventOfCode.py 1 2
In order to debug and test my code, I've also added the possibility to run a day, using the example input from Advent of Code. When my answer is wrong, I can solve the puzzle, using the example input to try if I get the same answer as in the example.
--
-----------------------------------------------------------------
_ _ _ ___ __ ___ _
/_\ __| |_ _____ _ _| |_ / _ \ / _| / __|___ __| |___
/ _ \/ _` \ V / -_) ' \ _| | (_) | _| | (__/ _ \/ _` / -_)
/_/ \_\__,_|\_/\___|_||_\__| \___/|_| \___\___/\__,_\___|
___ __ ___ ___
/'___`\ /'__`\ /'___`\ /'___`\
/\_\ /\ \ /\ \/\ \/\_\ /\ \ /\_\ /\ \
\/_/// /__\ \ \ \ \/_/// /__\/_/// /__
// /_\ \ \ \_\ \ // /_\ \ // /_\ \
/\______/ \ \____//\______/ /\______/
\/_____/ \/___/ \/_____/ \/_____/
-----------------------------------------------------------------
- Day 1 : "Calorie Counting"
- Answer for day 1, part 1: * 75501
- Answer for day 1, part 2: * 215594
-----------------------------------------------------------------
- Day 2 : "Rock Paper Scissors"
- Answer for day 2, part 1: * 14163
- Answer for day 2, part 2: * 12091
-----------------------------------------------------------------
- Day 3 : "Rucksack Reorganization"
- Answer for day 3, part 1: * 8105
- Answer for day 3, part 2: * 2363
-----------------------------------------------------------------
- Day 4 : "Camp Cleanup"
- Answer for day 4, part 1: * 588
- Answer for day 4, part 2: * 911
-----------------------------------------------------------------
- Day 5 : "Supply Stacks"
- Answer for day 5, part 1: * SVFDLGLWV
- Answer for day 5, part 2: * DCVTCVPCL
-----------------------------------------------------------------
- Day 6 : "Tuning Trouble"
- Answer for day 6, part 1: * 1140
- Answer for day 6, part 2: * 3495
-----------------------------------------------------------------
- Day 7 : "No Space Left On Device"
- Answer for day 7, part 1: * 1513699
- Answer for day 7, part 2: * 7991939
-----------------------------------------------------------------
- Day 8 : "Treetop Tree House"
- Answer for day 8, part 1: * 1672
- Answer for day 8, part 2: * 327180
-----------------------------------------------------------------
- Day 9 : "Rope Bridge"
- Answer for day 9, part 1: * 6236
- Answer for day 9, part 2: * 2449
-----------------------------------------------------------------
- Day 10 : "Day 10: Cathode-Ray Tube"
- Answer for day 10, part 1: * 13720
- Answer for day 10, part 2: *
####.###..#..#.###..#..#.####..##..#..#.
#....#..#.#..#.#..#.#..#....#.#..#.#..#.
###..###..#..#.#..#.####...#..#....####.
#....#..#.#..#.###..#..#..#...#....#..#.
#....#..#.#..#.#.#..#..#.#....#..#.#..#.
#....###...##..#..#.#..#.####..##..#..#.
-----------------------------------------------------------------
- Day 11 : "Monkey in the Middle"
- Answer for day 11, part 1: * 316888
- Answer for day 11, part 2: * 35270398814
-----------------------------------------------------------------