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 2021 Day 20 (BaseA Style)

jdunkerley79
16 - Nebula
16 - Nebula

Discussion thread for day 20 of the Advent of Code - https://adventofcode.com/2021/day/20

7 REPLIES 7
dsmdavid
11 - Bolide

I had the vague memory that weekends were easier other years... Very grateful for a softer Monday 😅

Spoiler
Using iteratives again. It was a curveball to see all the ocean floor alternating the lighting on then off. Edited the macro, so that cells beyond the board are off or on depending on the iteration (which means that it doesn't work with the sample algorithm...😅)
dsmdavid_1-1639998671674.png

 


dsmdavid_0-1639998381702.png

 

https://github.com/dsmdavid/AdventCode2021

cgoodman3
13 - Pulsar
13 - Pulsar

Well done @dsmdavid on being the first to two stars.

 

A nice return after that horrible weekend!

 

Spoiler
Main workflow
cgoodman3_0-1640003058249.png

Macro

cgoodman3_1-1640003090714.png


I solved the first part by not building the iterative macro and just repeating the step twice, using the spatial tools were helpful to visualise the output when I was originally getting warnings about it being too high. So could see it was framing my answer with # due to the algorithm starting with a #, so needed to remove this depending on iterations.

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
patrick_digan
16 - Nebula
16 - Nebula

Much easier today than the weekend. It would have been easier if 0 was a . like the example. 

Spoiler

Workflow:

patrick_digan_0-1640024486706.png

Macro:

patrick_digan_1-1640024526575.png

 

NicoleJohnson
14 - Magnetar
14 - Magnetar

Finally got a decent 2 part solution on this one! I did eventually enjoy this one after I figured out it was actually relevant that the image was infinitely large based on the algorithm value in position 0...

 

Spoiler
Dealing with position 0 being a # was... challenging. And like @dsmdavid  my original solution then no longer worked for the sample solution because of the "brute force" logic I included to make it work for my actual data... but then I added a check box to toggle that "brute force" logic on & off, so now it will work for both once again 🙂 

NicoleJohnson_0-1640133476587.png


The macro - works for both Part 1 & 2 by changing the numeric value in config, as well as now working for both sample & actual data!

NicoleJohnson_1-1640133578867.png

And with that, I've surpassed last year's total of 31 stars! (Shows 33, but I am counting it as 32 since I have absolutely NO idea what I did in Day 15 Part 1 to stumble into the correct answer, and since now I can't replicate the right answer, more research to come... hah)

 

Cheers!

NJ

AkimasaKajitani
15 - Aurora

This is a possible challenge after long time.

 

Spoiler
AkimasaKajitani_0-1640427676861.png

AkimasaKajitani_1-1640427694243.png

 

 

GitHub

https://github.com/AkimasaKajitani/AdventOfCode/tree/main/2021

SeanAdams
17 - Castor
17 - Castor

I've been bashing my head on day 19 for a while now, and took a quick break to do 20 - very fun one.

🙂 this is like a detuned version of the way that jpeg works!

 

Spoiler
The only tough bit here was ensuring that if we extend the cells beyond the border, you use the current cell value to do so (since it's infinite canvas).

Built this in 4 parts:

First a cleaner to turn the raw data in to the right shape
Then a macro that adds in blank space around the edges 
Then a join to the neighbours to get the right lookup value for the cell
A join to the enhancer based on this key 

SeanAdams_0-1640628647982.png



Here's the cleaner:
It splits up the translations into a list; and splits up the image into rows and columns

SeanAdams_1-1640628806808.png

 

Here's the bulker:
This adds on empty cells around our current image
SeanAdams_2-1640628879008.png


Iterator:
This is relatively simple - it bulks out the data if needed; then does the neighbour lookup; then joins and applies the translation and loops

SeanAdams_3-1640628973588.png


The Neighbour process:
This is where we generate all 9 neighbours for the current cell - and calculate the lookup value for the translation.
This is also the place where the infinite size of the image has an impact.

SeanAdams_4-1640629027760.png

 



Pang_Hee_Choy
10 - Fireball
Spoiler
thanks @patrick_digan for the workflow. 

by compare with your workflow, 
i still take 1 hours to find out the even-th iteration require to add "#" instead of "." 

Pang_Hee_Choy_0-1642047567415.png
Pang_Hee_Choy_1-1642047580836.png