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 2 (BaseA Style) - Dive!

jdunkerley79
16 - Nebula
16 - Nebula

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

26 REPLIES 26
cgoodman3
13 - Pulsar
13 - Pulsar

I was awake, a little after 5am but still at a time zone disadvantage!

 

Spoiler
cgoodman3_0-1638424444674.png

Lost a couple of mins on the second part by copying my multi-row formula but forgetting to update part of the IF statement, and couldn't work out why I got the wrong answer so had to load in the example to check my logic when I discovered the typo in my IF.

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

WELL. This one was, in the end, deceptively simple. Extremely grateful for @estherb47 who helped me re-read the instructions again. *face palm*

 

Spoiler
What got me on this one was not understanding that in the Part 2 instructions, they basically started new - I mistakenly assumed that the rules from Part 1 still applied as far as what happens when you got an up or down instruction. Some ambiguous wording got me confused for a bit, but as soon as that mistaken assumption was cleared up, it was an easy fix/straightforward data prep solution. Look at all those pretty blue tools...
NicoleJohnson_0-1638424418177.png

 

Cheers!

NJ 

cgoodman3
13 - Pulsar
13 - Pulsar

Yes I managed to beat @NicoleJohnson at posting! But I think you got the solution for the second star just before me!

 

Tip: If you want tool golf points then you don't need the first formula tool to set the positions at 0, as the multi-row formula has the option to set rows that don't exist to zero, so for the first commands they will all be based from 0,0

cgoodman3_0-1638424907590.png

 

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

Ahhh yes @cgoodman3 , but much like when I play actual golf, why hit the ball once when you can hit it three or four times instead? 🤣

 

Excellent tip. You get the green jacket today, particularly with your Part 1 “tool golf” solution!!

 

NJ

cgoodman3
13 - Pulsar
13 - Pulsar

I think you can do part 1 with just 1 multi row and do the calculation at the same time as working out the movement but I didn’t have the headspace to do it this morning.

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

Feeling a multi-row theme so far

Spoiler
OllieClarke_0-1638435675764.png

 

AkimasaKajitani
15 - Aurora

It took long time to understand the situation at Part2.

 

Spoiler
AkimasaKajitani_1-1638436331530.png

 

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

jdunkerley79
16 - Nebula
16 - Nebula

Bit late getting to it today...

 

Spoiler
jdunkerley79_0-1638445563717.png

Spotter part 2 was a small extension to part 1

AmandaH
7 - Meteor

Another easy day, but oddly satisfying. Anyone else feel the need to name their submarine?

 

Spoiler
Day2_Solution.PNG