diff options
author | Brian Chu <brianmchu42@gmail.com> | 2022-01-09 17:24:34 -0800 |
---|---|---|
committer | Brian Chu <brianmchu42@gmail.com> | 2022-01-09 17:24:34 -0800 |
commit | b45f31b01c165c64d9c821fc36244da5d950962e (patch) | |
tree | b71b6caec2f88cc5049bdcfc88cf9000c297836a | |
parent | dffde08c3fc0da933d597ccc907aa2e1186222db (diff) | |
download | AdventOfCode2016-b45f31b01c165c64d9c821fc36244da5d950962e.tar.gz |
solution for day 25 main
-rw-r--r-- | day25.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/day25.md b/day25.md new file mode 100644 index 0000000..7ff839c --- /dev/null +++ b/day25.md @@ -0,0 +1,17 @@ +Based on decompiling the code we realize that the program essentially accomplishes this: + +``` +d = a + 2548 +while true { + a = d + while a != 0 { + b = a % 2 + a /= 2 + output b + } +} +``` + +which basically takes the value of d and prints out the reverse binary representation over and over + +the lowest such number above 2548 is 2730, which in binary is 101010101010 so we initialize a to value 2730 - 2548 = 182 \ No newline at end of file |