6
votes
Day 23: Unstable Diffusion
Today's problem description: https://adventofcode.com/2022/day/23
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>
Data
elves are a set of points. I keep meaning to switch co-ordinates to complex numbers but maybe some other time.
Part 1
Feels hugely verbose. I really shouldn't read /r/adventofcode after I finish, feels bad man. The only mildly interesting thing here is refactoring
elf-garden
for part 2 that takes a sequence - similar to generators or streams -(in-range 10)
for part 1 and(in-naturals 1)
for part 2.Part 2
The refactoring pays off hugely for part 2, but obviously I wrote 2 different versions of almost the same code while solving the problem.