Discussion thread for day 11 of the Advent of Code - https://adventofcode.com/2021/day/11
Iterative macros are back with a vengeance.
Outer Macro
Inner Macro
Agreed, @bflick, back with a vengeance indeed
It was super slow (5 minutes for step 2) but I was happy with my macro.
Iterative Macro. The magic is the first multi-field-row tool which checks all 8 surrounding cells to see how much energy the cell needs to increase by. It's not very performant with 5+ minute run time, but I could probably clean up a few things to get a little speed back
It is difficult to understand the flashing mechanism, so it took the long time.
In any case, today is iterative macro day.
Spread Energy Macro : After increment, this macro repeats until finishing the spreading energy.
Git Hub
https://github.com/AkimasaKajitani/AdventOfCode/tree/main/2021
I'm learning a lot of marine biology. And continuously surprised with the number of diverse sensors available in the submarine.
https://github.com/dsmdavid/AdventCode2021
This exercise is constantly pushing my limit on the macro. Great when it works.
Level 1: standard macro, for each cell, find the adjacent cells, then do 1 iteration of cascade on the energy if current cell is 10 energy.
Level 2: iterate macro, for each step, iterate level 1 until stable state (i.e. no more cell has 10 energy)
Level 3: iterate macro, repeat run for 100 iterations, at each step count number of flashes.
For part 2, just increase the iteration limit, turns out it's much less than I expected. Done within 500 iterations.
I used two macros that are not as well known in Alteryx - the disco-ball macro and the Flash macro. Instead of "Preparation" or "Spatial" - look under the "strange marine" section in the tools. Used a batch macro with an iterative inside
... there's the disco ball macro.The Disco-ball & Flash MacroThis is relatively simple:- create a queue of cells that need to execute a flash- For each cell that creates a flash - apply this to the board and see what else goes above 10 - and add these to the queue- Repeat until all the flashes have been done.the only complexity here is being able to pass the updated board; and ALSO the updated queue through each iteration of the macro
only link to the 1 layer macro in 1st layer macroadd 1 and link to 2nd layer macro for flashonly then filter out o and count for day and flash.in 2nd macro,check the value if is 10. and count the value will add to adjacent.sum it and add to valuerepeat until nothing to add.workflow:
1st layer macro
2nd layer macro
Iterations within Iterations, could have used way less tools but I'm so far behind I'm doing for completion rather than finesse
Macro for Part 1:
Macro for Part 2:
and Part B of both: