Discussion thread for day 4 of the Advent of Code - https://adventofcode.com/2021/day/4
Day 4. I spent more time on part 2 (I thought it was straightforward on this logic, but turned into a section to adapt what I did for Part1)
Redone with NO MACRO this time!! Success!! WAY cleaner looking this way, and probably good practice in case we find ourselves facing another Intcode scenario this year... *shudders* (@patrick_digan , your string methods for non-macro Find & Replace functionality will be forever an inspiration to me...)
Cheers!
NJ
A rare case where solving for part 2 actually made the solution for part 1 somewhat easier
The iterative macro originally had some complex gymnastics to exit as soon it found the first solution. Adding in the requirement that we needed the first and last solution meant that I could simplify to just run until all the called numbers where processed
Dan
Scratched my head on part 1 then part 2 was easier as it used the same logic to start with.
I'm gonna look for a version without macro.
Took a while to get the macro order correct for me, went into some dead ends. (some steps can be cleaned) Run iterative macro for each board for final score, then batch macro for each board. Part 2 is easy for me as it is just a change of sort in the final results.
Also went a macro=less route.
I am not a huge fan of my solution for this one and felt like I made it more complicated for myself than it needed to be (which I confirmed after reviewing some of the other solutions), but it got there in the end.
I really enjoyed looking at the macro-less solutions from @bflick / @cgoodman3 / @dsmdavid / @AkimasaKajitani / @patrick_digan / @Aguisande / @NicoleJohnson / @grossal / @estherb47 - Very elegant, simple, and performant 👌.