General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2023 Day 4 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 4 of the Advent of Code - https://adventofcode.com/2023/day/4

48 REPLIES 48
joshbennett
11 - Bolide
11 - Bolide

Forgot to post my solution last night after (temporarily) giving up on the Python solution I attempted after solving in Alteryx.

 

Anyway, I used an iterative macro for part 2, and I don't regret it. Sorry not sorry. 

 

Spoiler
Screenshot 2023-12-04 142824.png

Watermark
12 - Quasar
12 - Quasar

Too many people mentioning iterative macro crashing their sys. I refused to use a macro.   Runtime = 0.5 sec

 

Spoiler
AOC 2023 Day 4.jpg

gawa
15 - Aurora
15 - Aurora

Tried to refine, but not getting much better.

Spoiler
Taking out Generate Row outside Macro makes running time somewhat faster. 
image.png
SeanAdams
17 - Castor
17 - Castor

First day that requires a macro - this is going to quickly become normal I reckon!

@clmc9601 - very elegant - I tackled the inner macro differently but I see why yours works!

 

Spoiler


Screenshot 2023-12-04 195817.png

Part 1: 
- Just parse the data out
- then do a join and summarize

Part 2:
- My embedded macro was a little more complex than Claire's.
- Each iteration, it takes the lowest number card remaining - outputs the total and expands it out below
- this repeats until it runs out of cards
Screenshot 2023-12-04 200108.png

 

estherb47
15 - Aurora
15 - Aurora

Very grateful to @patrick_digan , who showed me the magical use of the multirow formula tool during the Intcode fiasco of 2019

 

I did use what appears to be a useless summarize tool to figure out how many rows above I'd need to be counting. And I figured out the logic by modeling the sample data in Excel (whee, typing x into columns and then adding up and trying to discern a pattern!)

 

Spoiler
 

The logic, as I saw it, was that for a row above to add records to the current row, the number of cards generated for that row above must be greater than or equal to the numbers of rows above. For example, for 3 rows above, there need to be 3 or more generate cards to touch the current row. 

Not sure if it's the best way to solve this, and it did work and no macros. And my part 3 is efficient with only three tools (one of which isn't needed after the first run)

image.png

leonhekkert
8 - Asteroid

Fun to create an iterative macro after a long time

 

Spoiler
Day4.pngDay4Macro.png
LiuZhang
9 - Comet
Spoiler
4 - 1.png4 - 2.png
SuguruYoshinaga
9 - Comet
Spoiler
WF
image.png
MACRO
image.png
dyamaguchi
8 - Asteroid

My solution.

Spoiler
Snipaste_2023-12-06_00-28-55.pngSnipaste_2023-12-06_00-28-44.png

  

D_Kanabar
5 - Atom

Advent of Code Part 1. Feels a lot more messy than it should be 

Labels