Advent of Code 2021 (Days 21-25)
Source code
Day 21
A fairly enterntaining puzzle that has a lots of (seemingly unavoidable) nested processing cycles. Tricky part was figuring out that caching completed branches outcome is a tremendous speedup. Since lots of cycles are partially repeated the caching is very effective: hash storage would be noticeably faster than plain list cache, but I resorted to the latter to skim at least some time down because sadly I clearly don’t have enough :)
Day 22
Was discouraged from the beginning when saw that it is yet another puzzle that relies heavily on geometry - it was obvious that I have to split cubes in (up to) 6 upon adding/substracting new ones but the implementation itself took me a very long time - I didn’t know what to look up at first (it was AABB partitioning by the way) and then wrapping it all up to process input costed me another almost-sleepless night.
Day 23
I’ll be honest - I couldn’t figure out how to do this task programmatically so I just kind of solved it by hand :) It was like “Towers of Hanoi” basically, irritating but doable.
Day 24
Of all the puzzles that had little to do with programming this one gets one of the top spots. My carefully crafted pretend-assembly interpreter was “nothing special, but an honest work”. After I realized the bruteforce solution will take the rest of my life (literally) I banged my head on viable bruteforce solution some more before resorting to IRC and Reddit councils.
There I found out that this puzzle expects solving stuff “by hand” - disassembling provided input source code and figuring out common patterns for each digit and solving all that without doing any programming whatsoever.
That felt really lame and half-assed to me; I took the same half-assed approach and extracted “common denominators” from the input but the number I deduced on paper ended up being wrong for some reason. Probably I got mistaken somewhere in ~250 lines of data or mixed up numbers that I’ve written down; anyhow, at this point fun was long lost and I just borrowed some generic python solver from Reddit, printed out my numbers, hardcoded them into my program and that’s it.
Absolutely no guilt or remorse about using someone elses solution since my ALU-code interpreter for those numbers runs very nicely. Shame the task didn’t involve something more tricky interpreter-wise and less of “analyze your data visually”, that would make it a proper programming puzzle.
Day 25 - The End
Final puzzle thankfully was not that hard - straightforward but to complete it the attention to details was needed, as usual :D I found that kind of tasks the most enterntaining.
End stats:
--------Part 1-------- --------Part 2--------
Day Time Rank Score Time Rank Score
25 06:37:37 6264 0 19:30:31 5903 0
24 18:38:54 5485 0 18:39:25 5335 0
23 >24h 11268 0 >24h 8780 0
22 16:53:46 14335 0 20:26:58 8519 0
21 18:21:20 18258 0 21:43:41 12728 0
20 20:35:13 14777 0 21:02:12 14483 0
19 >24h 13574 0 >24h 13326 0
18 23:19:39 13205 0 23:19:54 12974 0
17 19:37:33 21328 0 19:45:59 19844 0
16 19:56:03 19963 0 20:53:14 18438 0
15 17:35:34 24989 0 19:00:53 21740 0
14 01:44:12 10279 0 19:14:38 28420 0
13 16:21:45 31888 0 16:56:59 31384 0
12 14:07:46 26564 0 19:34:09 29164 0
11 04:38:21 13727 0 04:47:50 13635 0
10 13:19:53 36944 0 15:14:22 36868 0
9 16:09:28 43846 0 18:21:38 36726 0
8 01:53:39 14843 0 >24h 41619 0
7 04:48:05 30342 0 07:49:38 35353 0
6 07:32:23 34595 0 17:02:14 46658 0
5 05:34:47 21376 0 08:56:46 27140 0
4 14:37:48 41860 0 15:34:50 39813 0
3 20:05:09 88936 0 23:53:09 68128 0
2 01:22:09 17497 0 02:22:53 22045 0
1 10:09:58 56935 0 14:56:36 70767 0