2025(01): hopsakaas that works
This commit is contained in:
@ -65,3 +65,33 @@ Following these rotations would cause the dial to move as follows:
|
|||||||
Because the dial points at `0` a total of three times during this process, the password in this example is _`3`_.
|
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?_
|
Analyze the rotations in your attached document. _What's the actual password to open the door?_
|
||||||
|
|
||||||
|
### Part Two
|
||||||
|
|
||||||
|
You're sure that's the right password, but the door won't open. You knock, but nobody answers. You build a snowman while you think.
|
||||||
|
|
||||||
|
As you're rolling the snowballs for your snowman, you find another security document that must have fallen into the snow:
|
||||||
|
|
||||||
|
"Due to newer security protocols, please use _password method <span title="You should have seen the chaos when the Elves overflowed their 32-bit password method counter.">0x434C49434B</span>_ until further notice."
|
||||||
|
|
||||||
|
You remember from the training seminar that "method 0x434C49434B" means you're actually supposed to count the number of times _any click_ causes the dial to point at `0`, regardless of whether it happens during a rotation or at the end of one.
|
||||||
|
|
||||||
|
Following the same rotations as in the above example, the dial points at zero a few extra times during its rotations:
|
||||||
|
|
||||||
|
* The dial starts by pointing at `50`.
|
||||||
|
* The dial is rotated `L68` to point at `82`; during this rotation, it points at `0` _once_.
|
||||||
|
* 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`; during this rotation, it points at `0` _once_.
|
||||||
|
* 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`; during this rotation, it points at `0` _once_.
|
||||||
|
|
||||||
|
In this example, the dial points at `0` three times at the end of a rotation, plus three more times during a rotation. So, in this example, the new password would be _`6`_.
|
||||||
|
|
||||||
|
Be careful: if the dial were pointing at `50`, a single rotation like `R1000` would cause the dial to point at `0` ten times before returning back to `50`!
|
||||||
|
|
||||||
|
Using password method 0x434C49434B, _what is the password to open the door?_
|
||||||
|
|||||||
4317
2025/01/input
Normal file
4317
2025/01/input
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,8 @@
|
|||||||
# TODO: Get the inout.
|
# TODO: Get the inout.
|
||||||
|
|
||||||
|
with open("input", "r") as fp:
|
||||||
|
moves = fp.readlines()
|
||||||
|
|
||||||
counter = 50
|
counter = 50
|
||||||
code = 0
|
code = 0
|
||||||
for move in moves:
|
for move in moves:
|
||||||
|
|||||||
Reference in New Issue
Block a user