summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--day25.md17
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