Discussion thread for day 8 of the Advent of Code : https://adventofcode.com/2020/day/8
Day 8!
Part 1 is simple, but Part 2 is too slow to search the result.
Part 1 is an Iterative macro and Part 2 is a Batch macro.
Iterative Macro:
Batch Macro:
As anonymous user #1105310
I was very happy that I managed to solve it without any macros! They are such a pain to debug, if you can avoid them its always good.
https://github.com/NedHarding/Advent2020/blob/main/Day8.yxmd
@NedHarding you're a madman but those multi row formulas are excellent.
Part 2 was tough for me. I ended up rebuilding and simplifying my initial iterative macro in order to solve part 2.
iterative
Batch
Solved part 2 without needing to do it with a batch macro by generating the rows for each of the 300 versions of the model input that are needed.
Same concept for the iterative macro for both parts, just a small tweak on part B so it exits when a solution is found.
Macro for Part B with the break when total records < records in previous step i.e. a solution has been found.
Sorry, no head for part 2 today.
Just for fun, I can generate rows and then do most all of the work in 1 formula tool using the Alteryx Abacus (non-BaseA). It's pretty fast.
I DID IT!! I figured out how to do this one without macros!!!!! Now to be fair, I solved it the hard & painful iterative-macro-within-an-iterative-macro way last night when I was trying to get stars... but then I spent all night not sleeping thinking there had to be a better way, and lo and behold, IT WORKED.
First solution (runs both parts in 30+ minutes, + Iterative Macro Inception):
Second solution (Runs both parts in ~26 seconds + NO MACROS):
Is BootCode the new Intcode? BRING IT ON.
Cheers!!
NJ
Definitely not winning tool golf here. And I love @NicoleJohnson 's method of putting the row skipping and accumulator into one tool. For my brain, worked better in 2 multirows. Plus I added another multirow tool to see if codes repeated because I hated that the unique tool sorted the data and then I had to sort again to get back into order.
23.1 seconds. No macros. Take that, Intcode nightmares!!! Part 1 only took .7 seconds, which amazed me.
Credit goes to @patrick_digan 's method of concatenating and replacing pieces of code from last year. Worked like a charm.