Discussion thread for day 14 of the Advent of Code - https://adventofcode.com/2023/day/14
Passing the turning point Day13, 2nd half of AoC has started from today.
If you are stuck in part2, collapse spoiler 👇
Today was very interesting, and it was very satisfying getting to reuse a macro I built for Day 13. I definitely like how simple all the standard macros make the workflows look. I may add explanation of algorithm tomorrow. This problem is much simpler, but the solution is quite elegant.
Edit: Added my workflow
Algorithm:
Workflows:
Probably my favorite puzzle so far! Just the right amount of trickery!
part 2 take 20~mins with AMP engine on.
Today's one is interesting.
My workflow is very messy.
My solution.
This puzzle reminds me Day17 in 2022(TETRIS!!).
I really enjoyed today's challenge - very interesting! I'm adding this to my list of problems to keep working at - I don't love my P2 approach and know that I could implement some logic for earlier stopping, just need a fresh brain to tackle it!
@CoG I was really wondering how di you put it off with 2 Fofrmula tools. Thank you so much for explaining it in detail.My approach is more like bubble floating up.I also seperate the Rows based on # after converting # as 9, O as 6, and . as 3.then we can use one Sort tool to do the magic. Number is easier to handle than the Letter 😂
And you and @gawa mentioned about the patterns and I plotted it for only 100 cycles with test data and it is beautiful.
I like any chance I get to use transformations and string parsing. Part 2 was a lot of trial and error, but I got there in the end (thank goodness for example data!).
Curious to see whether I'll manage more of these before Christmas - the holiday things are get busy around here!
P1 wasn't pretty and P2, well, ugly is an understatement to get the base loop to work. More in spoiler
update workflow with 40~ seconds.
REGEX_Replace([data], "(\.+)(O+)", "$2$1")​
and filter it if the rows nothing to move.hence, the iteration and data size are reduced, it speeds up 97%.updated macro:
Satisfying to finally get the solution, and I think I lucked out with a data set that lent itself to clarity as to what was repeated in the pattern.
Anyone else find it easier to solve for part 2 using the real data instead of the test data?
To figure out the repeats, I basically looked where consecutive rows that appeared more than once started. The first one marked the starting point. Looked where that repeated to find how many records in a cycle, and then extrapolated that pattern to 1000000 to find the answer.
@phottovy - I'm sort of irritated with you for how nice and compactly you did the N/E/S/W bananas. I overcomplicated mine by a factor of 100
Finaly done.