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 5 (BaseA Style)

jdunkerley79
16 - Nebula
16 - Nebula

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

18 REPLIES 18
bflick
7 - Meteor

I guess my teachers were right and we did need to remember y = mx + b. A great opportunity to use the generate rows tool!

Spoiler
Step 1: Parse out the lines
Challenge 1:
Step 2: Fitler for just horizontal and vertical
Step 3: Generate X positions
Step 4: Generate Y Positions
Step 4: Group by X,Ys of generated positions and count
Step 5: Filter for any > 1
Challenge 2:
Step 2: Calculate m and b
Step 3: Generate X positions
Step 4: Calculate y using y = mx + b
Step 4: Group by X,Ys of generated positions and count
Step 5: Filter for any > 1'
bflick_0-1638682527368.png

 

  

clmc9601
12 - Quasar

Lots of Generate Rows!

 

Spoiler
Screen Shot 2021-12-04 at 10.41.49 PM.png
cgoodman3
13 - Pulsar
13 - Pulsar
Spoiler
cgoodman3_0-1638684091836.png

Again another day where the part two wasn't that much more difficult than the first part. I just got stuck down a rabbit hole as the first attempt at building it out I had forgotten that there could be diagonals in both directions, so it's not just as case of generating the x.y co-ordinates as you need to factor in increasing and decreasing values in x and y and because I was using a join based on position instead of calculating the order needed to get my ordering correct. So while most of the time it is beneficial being able to use assumed sort in Alteryx if you are relying on a particular order you can't! So that resulted in the second part taking much longer than the first!

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
NicoleJohnson
14 - Magnetar
14 - Magnetar

Solved for stars and then played tool golf to get it down to this combination... Though I'm a bit disappointed in myself now that I see @bflick bringing back y=mx+b. Missed out on an opportunity to finally use that particular tidbit of knowledge! 😂

Spoiler
NicoleJohnson_0-1638684557445.png

 

Cheers!

NJ

AkimasaKajitani
15 - Aurora

I use only one Generate Row tool to make diagonal line. It is a pretty forceful way. But it took long time to make the condition expression.

 

Spoiler
AkimasaKajitani_0-1638685989345.png

 

GitHub

https://github.com/AkimasaKajitani/AdventOfCode

estherb47
15 - Aurora
15 - Aurora

Wow, taking me back to HS math. 

 

abs(ATAN2([y1]-[y2], [x1]-[x2]))*180/3.14 (to find 45 degree diagonal lines)

y=mx+b

 

My solution resembles @bflick 's solution

 

Spoiler
estherb47_0-1638687525016.png

 

grossal
15 - Aurora
15 - Aurora

Very straight forward this time. Could have simplified the first one, but I'll need breakfast first.

 

Spoiler
grossal_0-1638694919824.png

 

dsmdavid
11 - Bolide
Spoiler
Thought this could be a good fun for spatial or golf. Went with golf...
dsmdavid_0-1638702661719.png

 

https://github.com/dsmdavid/AdventCode2021

patrick_digan
16 - Nebula
16 - Nebula
Spoiler
patrick_digan_0-1638707649454.png