8
votes
Day 22: Crab Combat
Today's problem description: https://adventofcode.com/2020/day/22
Join the Tildes private leaderboard! You can do that on this page, by entering join code 730956-de85ce0c
.
Please post your solutions in your own top-level comment. Here's a template you can copy-paste into your comment to format it nicely, with the code collapsed by default inside an expandable section with syntax highlighting (you can replace python
with any of the "short names" listed in this page of supported languages):
<details>
<summary>Part 1</summary>
```python
Your code here.
```
</details>
Python
Repo Link
Part 1
Wow... compared to the past few days, the problem today was pretty straightforward (much more similar to the problems during the first week). I just implemented the game as described and that was it.
Part 2
I almost went to bed because the recursive game seemed too confusing to implement, but I decided to buckle down and just go bullet by bullet point. This is reflected in the commented sections below... I found placing those comments as really useful for figuring out what exactly I needed to do to implement the game.
That said, once you see what is going on, then it really it just a matter of coding in the rules of the game as described. I did make a dumb mistake of forgetting to add the current configuration to the cache... which lead to the infinite loop the write-up warns about. After a few minutes of tracing, I realized my mistake and was able to fix it.
well, I can do part one with sheets. I may have been able to do part 2, but recursion is always an issue.
this is the crazy sheet with 2323 formulas :)