Discussion thread for day 11 of the Advent of Code : https://adventofcode.com/2020/day/11
Not the fastest or cleanest for part 2...
Part 2 (slow and messy :():
I've not solved it yet, but if anyone wants more background reading this is a modified version of Conway's Game of Life which I did play once before in Alteryx 🙂
https://www.youtube.com/watch?v=hcrVS5YOrm4&feature=emb_title
I'm almost embarrassed by those ugly generate rows. Almost.
Same iterative solves both, just update the rows that enter it.
At last a spatial problem!
Base workflow
Iterative Macro
Part 2 is going to need a refactor!
And here it is after the refactor 🙂
Parent workflow
Iterative Macro
One macro for both parts for me. My hint would be to work out your seat pairings list before iterating through the occupancy changes.
Mine was a mess today, but I got there in the end.
Mine was way to messy and hacked together for me to post... Wasn't that hard in theory, in practice it drove me crazy debugging it.
Quite happy with mine, my final solution makes up for the nightmare mis-read of part 1! Didn't resort to reddit or here today 🙂
I had to leave this for a while to go and work after part 1 - wasted an hour by misinterpreting the part one as look 8 seats in each direction, not 8 seats, 1 in each direction.... DOH!
Iterative macro for part 1, then an iterative to prepare for part 2 by looking for the next seat in each direction for each seat as this doesn't change.
Then a modification of my part 1 macro to solve part 2. <1 min so not too horrible either.
Full
macro1
macro2 to prep part 2
macro 3 to solve part 2
Edit - also had fun seeing how the seats filled up:-
https://public.tableau.com/profile/petergb#!/vizhome/Day11_16077110205010/AoCDay11