Discussion thread for day 4 of the Advent of Code - https://adventofcode.com/2024/day/4
Whoo! I enjoyed this tremendously. I will include a more thorough explanation for my approach below later (in the form of a YouTube video), but for now here is my solution.
Solution Screenshot (Updated to Simplify):
Tool Golf V3 Solution (10 Tools per Part):
Tool Golf V4 (Part 1: 6 Tools, Part 2: 7 Tools):
That was a really neat one. Similar to some of the harder ones last year, but with fewer complications. Part 2 seemed easier than Part 1, though that could just be having done Part 1 first. Interesting to see the different ways people deal with this.
Sharing file this time because it's pretty and I like the solution. Those have not both been true on previous days.
have to use macro this time. diagonal is hard to do without macro
and luckily I save some macro last few years. like split to x and y. and generate the adjacent location.
it save some time to re-build it.
This one was a fun challenge! There's a lot of sloppy design in this first pass, but I'm excited to clean up the logic later this week.
Substring([data],[Engine.IterationNumber],1)+ SubString([Row-1:data],[Engine.IterationNumber]+1,1)+ Substring([Row-2:data],[Engine.IterationNumber]+2,1)+ SubString([Row-3:data],[Engine.IterationNumber]+3,1)​
It's challenges like these that make me wish I had an index listing all the things I've built in the previous Advent of Code years to solve the same exact thing... "Alexa, tell me how I solved this 'find the coordinates' problem the last 20 times it's come up in Advent of Code..."
Today's "new Designer features in action" shout-outs: Dark Mode (because I didn't get enough sleep last night getting stuck on Day 3 Part 2, so my eyes already hurt), and Group By in the Record ID tool! ❤️
Nice way to solve a crossword
Okay, time for bed. *NOTE: made some tweaks today and reposted so my solution is more clearly labeled and easier to follow (that seems to go out the window at 1 in the morning...)
My solution! This is messy.
Today it took a long time because I was away for 20-30 minutes in the middle of Part 2. I don't like diagonal...
Wow, my solution is way over-engineered compared to the simpler ones. Looking forward to reviewing the elegant ones another day!
I wanted to make it simpler, but it became complicated. 😣
Way overthought part 2; going down the rabbit hole of matrix manipulation...when I finally realized a few formulas would work nicely.
Could be more elegant, but I'm happy with my stars. 🌟🌟🎅
Question 2 was toooooooo difficult
Restarted like 5 times with different approaches cause I could not figure out how to build the matrix but found a neat way in the community!
Brutal Force again but it costs me only 0.6 seconds to run for P1 and P2.
At first I made messy and ugly WF but now I refined it with 'Spatial Analysis' version as fun analysis.
When it comes to X-Y coordinates, I cannot stop using spatial analysis.
That was tough! Horizontal and Vertical were pretty nice, but I had to really think about how to transform the data for those diagonals. I learnt a new function today too: Regex_CountMatches(), which counts the occurrence of a pattern inside a string. By transforming the data for each of the directions and concatenating new strings, I could use the function to get accurate counts
My solution.
That was great
I had to use two batch macros to solve it. I am really curious how other experts solved it. I believe it will be very inspiring :P
Picking up a bit
(([0_col]=[1_col] AND [1_col]=[2_col] AND [2_col]=[col]) AND (ABS([0_Row]-[1_Row])=1 AND ABS([1_Row]-[2_Row])=1 AND ABS([2_Row]-[Row])=1)) OR (([0_Row]=[1_Row] AND [1_Row]=[2_Row] AND [2_Row]=[Row]) AND (ABS([0_col]-[1_col])=1 AND ABS([1_col]-[2_col])=1 AND ABS([2_col]-[col])=1)) OR (([col]-[2_col]=1 AND [2_col]-[1_col]=1 AND [1_col]-[0_col]=1) AND (([Row]-[2_Row]=1 AND [2_Row]-[1_Row]=1 AND [1_Row]-[0_Row]=1) OR ([Row]-[2_Row]=-1 AND [2_Row]-[1_Row]=-1 AND [1_Row]-[0_Row]=-1))) OR (([col]-[2_col]=-1 AND [2_col]-[1_col]=-1 AND [1_col]-[0_col]=-1) AND (([Row]-[2_Row]=1 AND [2_Row]-[1_Row]=1 AND [1_Row]-[0_Row]=1) OR ([Row]-[2_Row]=-1 AND [2_Row]-[1_Row]=-1 AND [1_Row]-[0_Row]=-1))) ​
If you value your mental well-being then please don't open this spoiler. However, as a wise man once said... "2 stars is 2 stars my son".
Phew. Finally got this one. I should have flexed my AoC muscles earlier, this one brought back all the memories. Hope you all managed to find me!!!
SAM was everywhere in that wordsearch! Was a massive distraction!
D4. More in spoiler
Definitely helped referencing other users in this thread. Was definitely a challenge for me!
A good challenge!
I usually LOATHE the grid-based challenges, but this one tickled my inner word nerd! Decided against a macro for Part 1, and was glad to have taken the slower approach when I got to Part 2.
:-) it's great to see the progression of thinking as you refined this @CoG
Agree with you @NicoleJ - the record ID with grouping really is a great addition - I expect the tile tool to get very very lonely now.