diff options
Diffstat (limited to 'src/21/part1')
| -rw-r--r-- | src/21/part1 | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/21/part1 b/src/21/part1 new file mode 100644 index 0000000..679f3ec --- /dev/null +++ b/src/21/part1 @@ -0,0 +1,41 @@ +--- Day 21: Chronal Conversion --- + +You should have been watching where you were going, because as you wander the new North Pole base, +you trip and fall into a very deep hole! + +Just kidding. You're falling through time again. + +If you keep up your current pace, you should have resolved all of the temporal anomalies by the next +time the device activates. Since you have very little interest in browsing history in 500-year +increments for the rest of your life, you need to find a way to get back to your present time. + +After a little research, you discover two important facts about the behavior of the device: + +First, you discover that the device is hard-wired to always send you back in time in 500-year +increments. Changing this is probably not feasible. + +Second, you discover the [1m[97mactivation system[0m (your puzzle input) for the time travel module. +Currently, it appears to [1m[97mrun forever without halting[0m. + +If you can cause the activation system to [1m[97mhalt[0m at a specific moment, maybe you can make the device +send you so far back in time that you cause an integer underflow [1m[97min time itself[0m and wrap around back +to your current time! + +The device executes the program as specified in manual section one and manual section two. + +Your goal is to figure out how the program works and cause it to halt. You can only control +[1m[97mregister 0[0m; every other register begins at 0 as usual. + +Because time travel is a dangerous activity, the activation system begins with a few instructions +which verify that [1m[97mbitwise AND[0m (via bani) does a [1m[97mnumeric[0m operation and [1m[97mnot[0m an operation as if the +inputs were interpreted as strings. If the test fails, it enters an infinite loop re-running the +test instead of allowing the program to execute normally. If the test passes, the program +continues, and assumes that [1m[97mall other bitwise operations[0m (banr, bori, and borr) also interpret their +inputs as [1m[97mnumbers[0m. (Clearly, the Elves who wrote this system were worried that someone might +introduce a bug while trying to emulate this system with a scripting language.) + +[1m[97mWhat is the lowest non-negative integer value for register 0 that causes the program to halt after +executing the fewest instructions?[0m (Executing the same instruction multiple times counts as multiple +instructions executed.) + + |
