That darn Conway is persistent, isn't he?! That's right, Day 18 is looking like the return of Conway, but in 2 dimensions, and with 3 possible states (Open Ground, Wooded Acre, and Lumberyard) as opposed to the less complicated Alive or Dead we saw a few days ago.
It'll be interesting to see if the repeating semi-stable shapes that we see in a normal 2D Conway's Game of Life are present here or how having 3 possible states affects them.
Good luck! I wood love to see your solutions! 🎄
Top comments (6)
JavaScript solution
I'm gonna omit reader.js which is the same as the other solutions and jump to the point:
18-common.js
18a.js
18b.js
For Part 2 I logged out the results and manually counted period length that I used to calculate my solution. I guess I could calculate the period programmatically, but I'm just too lazy :)
readFile.php
Very similar to Conway's Life, but the result is kind of more life-like.
A python solution very similar to that of day 12.
Yawn. It was a relief to get something solvable after the problems from Saturday and Monday which were incredibly hard, but another Conway's Game of Life, with another huge iteration count? Just cranking the handle here, nothing new to solve.
I modelled it with a 2D array. Getting more familiar with Kotlin arrays and sequences now.
I made an infinite sequence of states again:
So part 1 was trivial:
For part 2 I made a generic loop finder:
Then used this to do the old find-loop-run-last-few-iterations dance:
Also, Conway’s Game of Life? More like Conway’s Game of Logs! 😬