2025(01): let's start with 2025!

This commit is contained in:
2025-12-01 09:07:12 +01:00
parent ef33a04975
commit a07af7efe9
2 changed files with 74 additions and 0 deletions

67
2025/01/README.md Normal file
View File

@ -0,0 +1,67 @@
# Day 1: Secret Entrance
[https://adventofcode.com/2025/day/1](https://adventofcode.com/2025/day/1)
## Description
### Part One
The Elves have good news and bad news.
The good news is that they've discovered [project management](https://en.wikipedia.org/wiki/Project_management)! This has given them the tools they need to prevent their usual Christmas emergency. For example, they now know that the North Pole decorations need to be finished soon so that other critical tasks can start on time.
The bad news is that they've realized they have a _different_ emergency: according to their resource planning, none of them have any time left to decorate the North Pole!
To save Christmas, the Elves need _you_ to _finish decorating the North Pole by December 12th_.
Collect stars by solving puzzles. Two puzzles will be made available on each day; the second puzzle is unlocked when you complete the first. Each puzzle grants _one star_. Good luck!
You arrive at the secret entrance to the North Pole base ready to start decorating. Unfortunately, the _password_ seems to have been changed, so you can't get in. A document taped to the wall helpfully explains:
"Due to new security protocols, the password is locked in the safe below. Please see the attached document for the new combination."
The safe has a dial with only an arrow on it; around the dial are the numbers `0` through `99` in order. As you turn the dial, it makes a small _click_ noise as it reaches each number.
The attached document (your puzzle input) contains a sequence of _rotations_, one per line, which tell you how to open the safe. A rotation starts with an `L` or `R` which indicates whether the rotation should be to the _left_ (toward lower numbers) or to the _right_ (toward higher numbers). Then, the rotation has a _distance_ value which indicates how many clicks the dial should be rotated in that direction.
So, if the dial were pointing at `11`, a rotation of `R8` would cause the dial to point at `19`. After that, a rotation of `L19` would cause it to point at `0`.
Because the dial is a circle, turning the dial _left from `0`_ one click makes it point at `99`. Similarly, turning the dial _right from `99`_ one click makes it point at `0`.
So, if the dial were pointing at `5`, a rotation of `L10` would cause it to point at `95`. After that, a rotation of `R5` could cause it to point at `0`.
The dial starts by pointing at `50`.
You could follow the instructions, but your recent required official North Pole secret entrance security training seminar taught you that the safe is actually a decoy. The actual password is _the number of times the dial is left pointing at `0` after any rotation in the sequence_.
For example, suppose the attached document contained the following rotations:
L68
L30
R48
L5
R60
L55
L1
L99
R14
L82
Following these rotations would cause the dial to move as follows:
* The dial starts by pointing at `50`.
* The dial is rotated `L68` to point at `82`.
* The dial is rotated `L30` to point at `52`.
* The dial is rotated `R48` to point at _`0`_.
* The dial is rotated `L5` to point at `95`.
* The dial is rotated `R60` to point at `55`.
* The dial is rotated `L55` to point at _`0`_.
* The dial is rotated `L1` to point at `99`.
* The dial is rotated `L99` to point at _`0`_.
* The dial is rotated `R14` to point at `14`.
* The dial is rotated `L82` to point at `32`.
Because the dial points at `0` a total of three times during this process, the password in this example is _`3`_.
Analyze the rotations in your attached document. _What's the actual password to open the door?_

7
2025/README.md Normal file
View File

@ -0,0 +1,7 @@
# Advent of Code 2025 #
Yesterday evening, I discussed Advent of Code with some friends.
I was interested, and so were they -- as long as we weren't that strict about doing the exercises.
Let's see what this year brings.
I will probably start in Python because puzzles are fun enough on their own, no need to add language complexity.