Discussion thread for day 3 of the Advent of Code - https://adventofcode.com/2021/day/3
The challenge 1 is very simple. But it took long time for challenge 2.
https://github.com/AkimasaKajitani/AdventOfCode/tree/main/2021
I am trying to expand my thinking around the design patterns for these sort of problems that are recursive. Any other ideas instead of the straight-forward iterative macro? We have so many analytical problems like this that are path oriented meaning ok find the first number THEN do this this then do this. I want to be able to do that in one shot 🙂
Will add my solution later. To get an answer quickly, I created an iterative macro, copied it, and just changed the logic for the lower numbers.
And so begins the descent into madness!!
Dan
Iterative for day 3, it escalated quickly ...
Built two different macros for part 2 with one slight change but I think it can be optimised using only one macro.
I followed a very similar route to @bflick and @cgoodman3
Here's the macro that does the work - iterative macro
This probably took me WAAAYYY longer than it should have, but it's my first macro, and an iterative one at that! Pretty happy with the results after comparing to what other people did. The part that actually hung me up for too long was the case where the bit counts were equal for a particular position; had to read the problem/example statement a bit closer.... Oh, well, finally figured it out.
I really liked this one and despite trying desperately not to, I learned to use iterative macros
Macro: i used text input because lazy