Discussion thread for day 7 of the Advent of Code : https://adventofcode.com/2020/day/7
Golly, I do love me an iterative macro!
For Part 1 macro, used an iterative process that found the parent of every inner bag (and then the parent of that parent in the next iteration).
Cheers!
NJ
Modified my standard/iterative inception macro set that I used for building trial balances. After finishing I see that I could have used a single standard/iterative macro set to do both a&b, but it's Sunday night and there is a drink and a dip in the hot tub waiting.
Day 7!
I often fall into the trap of repetitive macros...
Part1 Macro :
Part1 Macro :
As anonymous user #1105310
Day 7 | iterative macros always make my head hurt but got there...
My brain was not working well enough for iterative macros this morning...
Think mine is a little different to others but same general idea
Macro:
Flows on GitHub: https://github.com/jdunkerley/adventofcode
Note to self - Must read the question. I forgot to swap the inner bag to be outer bags in the second part so wasted a lot of time doing that!
Macro for part A - familiar heirarchy macro
Macro for part B:
Similar to others'
also, keeping track of the lineage...for no apparent good reason (yet, who knows what future days have in store for us...).
https://github.com/dsmdavid/AdventCode2020