Discussion thread for day 20 of the Advent of Code - https://adventofcode.com/2021/day/20
I had the vague memory that weekends were easier other years... Very grateful for a softer Monday 😅
Well done @dsmdavid on being the first to two stars.
A nice return after that horrible weekend!
Macro
I solved the first part by not building the iterative macro and just repeating the step twice, using the spatial tools were helpful to visualise the output when I was originally getting warnings about it being too high. So could see it was framing my answer with # due to the algorithm starting with a #, so needed to remove this depending on iterations.
Much easier today than the weekend. It would have been easier if 0 was a . like the example.
Workflow:
Macro:
Finally got a decent 2 part solution on this one! I did eventually enjoy this one after I figured out it was actually relevant that the image was infinitely large based on the algorithm value in position 0...
The macro - works for both Part 1 & 2 by changing the numeric value in config, as well as now working for both sample & actual data!
And with that, I've surpassed last year's total of 31 stars! (Shows 33, but I am counting it as 32 since I have absolutely NO idea what I did in Day 15 Part 1 to stumble into the correct answer, and since now I can't replicate the right answer, more research to come... hah)
Cheers!
NJ
This is a possible challenge after long time.
GitHub
https://github.com/AkimasaKajitani/AdventOfCode/tree/main/2021
I've been bashing my head on day 19 for a while now, and took a quick break to do 20 - very fun one.
🙂 this is like a detuned version of the way that jpeg works!
Here's the cleaner:
It splits up the translations into a list; and splits up the image into rows and columns
Here's the bulker:
Iterator:
This is relatively simple - it bulks out the data if needed; then does the neighbour lookup; then joins and applies the translation and loops
The Neighbour process:
This is where we generate all 9 neighbours for the current cell - and calculate the lookup value for the translation.
This is also the place where the infinite size of the image has an impact.