Discussion thread for day 8 of the Advent of Code : https://adventofcode.com/2020/day/8
This is far too close to IntCode...
First part was straightforward; second part took a little longer to debug and get the Join correct at the end.
Looking at @jdunkerley79 and @T_Willins solutions, I may have overengineered my macro a bit!
Part 1:
Iterative Macro:
Part 2:
In the above batch macro, I used the same iterative macro from part 1, though I was not pleased with the performance results so am looking forward to looking through each of the other solutions to understand how I may have been able to do this more efficiently!
Nested iteratives... as @jdunkerley79 says... IntCode, this year I'm ready for you. Or not.
Nested iterative... as @jdunkerley79 says... this year I'm ready for the IntCode. Or not.
Not especially happy with my approach as it took a *long* time to solve part 2. Here it is anyway though
Closed a container, alteryx crashed, stuck in an endless loop of open alteryx hang on file recovery... Ironic..
Managed similar to above solutions, iterative to solve, batch to feed in swapped instructions. Definitely could be tidier but got the stars so happy for now...
Similar to above. Iterative to model the CPU and batch to modify the inputs
Dan
Very happy with mine, I managed to use append fields over joins which I think helped with performance and managed to keep tools to a minimum in the first macro. The second macro needed a few extra tools to exit its loop at the right point.
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.
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.
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
https://github.com/AlteryxNJ/AdventOfCode_2020
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.
And nominated for the dirtiest solution ...