General Discussions

Discuss a wide range of topics! Questions about the Alteryx Platform should be directed to the appropriate Product discussion forum.

Advent of Code 2020 - BaseA Style (Day 17)

Alteryx Certified Partner

Discussion thread for day 17 of the Advent of Code :

16 - Nebula
16 - Nebula

Main issue with today was understanding the example... and I refused to do iterative as wanted to debug easier


And the inner macro:




12 - Quasar

@jdunkerley79 the example was pretty horrid. I think it could have been much more clear without giving too much away.


Here is my solve. I took the iterative route for both parts and it ended up being surprisingly similar to my day 11 solution. 



part 1 iterative


part 2 iterative




Alteryx Certified Partner



I almost gave up when I couldn't understand the example...It took much time. I agree with @jdunkerley79  on this point.

Today's my solution is Iterative route.



Part1 Iterative Macro

Part 2 Iterative Macro : Add w-axis to Part1 Macro


 Finally, my challenge worked.


AS anonymous user #1105310


Alteryx Partner

I concur that the example was difficult to understand (at least for me, it took me a while to realize that there were rows/columns disappearing).

I went with an iterative, it required minor changes to incorporate the "w" from the second part.


I wondered if it would be any faster to precompute the whole board since I thought so many generate rows couldn't be that good



16 - Nebula
16 - Nebula

I went for slow and simple with an iterative macro. I just computed entire board plus an extra space or 2. Lots of copying and pasting.




Alteryx Certified Partner

Fun one this, mine runs in 0.8s for the whole flow. Two separate macros for 3d and 4d. 😊


Three performance tips for me.
1) filter out "." values you don't need them.
2) Generate only your collisions, this follows from 1)
3) shift your plane to stay within byte data types. 

Screenshot 2020-12-18 013000.png

Part 2 macro. This has 1 more generate rows than my part 1 macro for the extra w dimension. This could have its condition toggled and folded back into one macro. 

My macro has a toggle for the number of iterations as I expected us to have to run 100 iterations in part 2 or something, I didn't need the toggle in the end and could have hard coded "6 iterations but I left it in anyway and made for a nice gif in the post below. 

My macro steps.
1) Filter out "." from the initial data. This could in fact be done outside the macro as its not used after step 1. 
2) generate collisions in each dimension, tripling rows at each step, looking at -1,self,+1.
3) tag the centre self collision.
4) keep only cubes with 2 or 3 collisions.
5) join back on against self colliders. 
6) filter to only active cubes for next iteration.
7) repeat.
Screenshot 2020-12-18 012935.png

Alteryx Certified Partner

50 iterations of part 1 as a gif 🙂



Alteryx Certified Partner

Optimised and golfed, 1 macro with a toggle for 3 or 4 dimensions. Workflow runs in 0.7s but it looks much cleaner now.


AoC v2 Workflow.png

Macro, and no purple tools used 🙂AoC new Macro.png
Alteryx Certified Partner

Definitely not clean but works !


Capture d’écran 2020-12-21 à 22.29.56.pngCapture d’écran 2020-12-21 à 22.43.24.pngCapture d’écran 2020-12-21 à 22.46.24.png