Advent of Code 2020 - BaseA Style (Day 11)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Discussion thread for day 11 of the Advent of Code : https://adventofcode.com/2020/day/11
- Labels:
- Advent of Code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Not the fastest or cleanest for part 2...
Part 2 (slow and messy :():
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
https://www.linkedin.com/in/adriley/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm almost embarrassed by those ugly generate rows. Almost.
Same iterative solves both, just update the rows that enter it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
At last a spatial problem!
Base workflow
Iterative Macro
Part 2 is going to need a refactor!
https://www.linkedin.com/in/adriley/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
And here it is after the refactor 🙂
Parent workflow
Iterative Macro
https://www.linkedin.com/in/adriley/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
One macro for both parts for me. My hint would be to work out your seat pairings list before iterating through the occupancy changes.
A few notes on the solution:
- I used row and col fields to find seat pairings, but then combined those into a single seatid field before going into the macro.
- I added ring of empty "." spaces around the room to avoid wraparound issues on the edges.
- Once spaces have been given an ID, empty "." are not needed in the iteration checks, they always stay "." and don't affect seating choices so they're filtered out before going into the macros or working out the next seat in part 2.
Iterative Macro. Half of the tools here are just creating a proper escape for the iterations as opposed to pair matching.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mine was a mess today, but I got there in the end.
i used my normal approach with these AOC problems using a single long string. It makes it fairly easy to work with and bebug, but It just isn't performant when you have to replicate the string a bunch. Glad this one's behind me solved. I'm sure the Alteryx Abacus would make it much more performant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
