My solutions for adventofcode.com (2016) with Python.
- Solution for a day can calculate part 1 and 2
- Input is loaded from file
input.txtinside the folder of the day - Solutions of a day have to define their own calculate method
- Sets up and tears down calculation of a solution for a day
- Mocks the input from the
input.txtby an input string
- 2D point inside cartesian coordinate system
- Set and get x and y coordinates
- Add, sub and neg points
- Calc euclidean and manhattan distances between points
- Print point coordinates
- Map based on Image class (Pillow)
- Set and get values for 2D points
- Get minimum and maximum coordinates of set points
- Show map image
- Image output gets flipped depend on coordinate origin
- Standard is 9-button keypad
- Load custom keypad from JSON file
- Move finger in direction
- Press button and append code
- Set and get side lengths
- Check if triangle is possible
- Sortable dictionary
- Get sorted strings with arbitrary length
| Day | Task | Python modules | My modules |
|---|---|---|---|
| 01 | Find shortest path and cross point | copy, math, PIL | Point2D, Map |
| 02 | Find codes at keypads | os, json | Keypad |
| 03 | Check triangles | re | Triangle |
| 04 | Encrypt and check room names | re, collections, operator | Dict |
| 05 | Create password from MD5 hashes | hashlib | - |
| 06 | Find message from repetition code | collections, operator | Dict |
| 07 | Match ABBA and ABA patterns | re | - |