Discussion thread for day 18 of the Advent of Code : https://adventofcode.com/2020/day/18
Here's me, lots of lovely regex today. 1.4s runtime.
regex_replace([data],"(.*?)(\d+)([\+\*])(\d+)(\.*)", "$1" +ToString(ToNumber("$2")...
Regex and substrings everywhere... 0.6s tho
@jdunkerley79 neat. I couldn't work out getting into fewer formula tools.
Here is my solve. It's a bit 'tooly'. I figured there was a better way to solve this after I was an hour in, but by that point in the evening I was too stubborn and tired to turn back.
Thanks for detailing your solve @Balders. I may give it another go with a similar strategy.
Anyway, I ended up with 3 iterative macros; one to solve the parenthesis groupings and the other two to apply the logic for either part.
Parenthesis Grouping Macro
Part 1 Iterative
Part 2 Iterative
I solved the problem via brute force and lots of copying and pasting tools instead of a macro. I'm posting my workflow here for comedic relief
Day18!
Today I don't use any macro...
AS anonymous user #1105310
https://github.com/AkimasaKajitani/AdventOfCode
I'm trying to understand better how to replace macros with combinations of generate rows & multirows. Having fun even if the formulas inside are terrible to debug...(can't imagine inheriting one workflow where someone did something like this...)
Previous
I again created the iterative first, then the generate rows
My regex is so so, and probably overcomplicated the formula, will need to investigate that neat workflow by @jdunkerley79 🙂
Here's part 1. After making the effort to minimize the use of macros in previous days, I just gave in today and built an iterative one in about the same time that it takes me to ensure that the parentheses line up in nested IIF statements in the non-macro versions built previously. Runs quickly as well, 0.3s, since it only iterates once per level of parentheses and my input set was never nested more that 2 deep.
Dan