Skip to content

Python solutions for Advent of Code 2022

Notifications You must be signed in to change notification settings

albertosantagostino/AoC-2022

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2022 🎄

Day 1 2 📃 ⏲️ Day 1 2 📃 ⏲️
01 day01.py 🟢🟢 14 day14.py 🟢🟢
02 day02.py 🟢🟢 15 day15.py 🟢
03 day03.py 🟢🟢 16 day16.py
04 day04.py 🟢🟢 17 day17.py
05 day05.py 🟢🟢 18 day18.py 🟢
06 day06.py 🟢🟢 19 day19.py
07 day07.py 🟢🟢 20 day20.py 🟢🟢
08 day08.py 🟢🟢 21 day21.py 🟢🟢
09 day09.py 🟢🟢 22
10 day10.py 🟢🟢 23
11 day11.py 🟢🟢 24
12 day12.py 🟢🟢 25
13 day13.py 🟢🟢

🟢 < 1 day | 🟡 1÷7 days | 🟠 = 7÷30 days | 💤 > 30 days

🎵 On the Nth day of Christmas, my true love sent to me 🎶

  1. An elf filled with chocolate
  2. An illegal "rock paper scissors" tournament
  3. A band of smuggler elves
  4. Drunk elves cleaning after a rave party
  5. A sketchy operation at the dock
  6. Another broken device
  7. Yet another broken computer (IT department must be really bad)
  8. A huge burning forest
  9. An OSHA violation (missing safety railings)
  10. A really old broken television
  11. Monkeys teaching me modular arithmetic while mocking me
  12. An horribly long and convoluted hiking trail
  13. Someone sending a distress signal without checksumming it
  14. A dangerous and uninsured Indiana Jones style expedition
  15. ...
  16. ...
  17. ...
  18. ...
  19. ...
  20. A paranoid Santa encrypting coordinates in a weird way
  21. Polyglot elephants (not so proficient in listening)

Only added when both parts are completed, as it seems appropriate to joke only about totally resolved things (in general)

Suggested Christmas songs 🔔

How to run

Python 3.9 and poetry required. From the root folder:

# Prepare virtualenv (will be placed at .venv/). Only needed the first time
poetry install
# Activate the virtualenv
source .venv/bin/activate
# Run the solution
python3.9 src/day__.py

The script src/day00_template.py is a template
Scripts are configured to automatically download puzzle inputs

Setup (automatic puzzle input download)

To get and set your credentials: login into AoC, open the Web Developer Tools (CTRL+SHIFT+I). Go to the Storage tab (or Application/Storage in Chrome) and copy the value of your session cookie into the aoc_cookie entry of config.json

Security note: do not commit the config.json file as it contains your personal cookie. Run git update-index --assume-unchanged config.json to prevent git from tracking the file