A bit disappointed with Day 20 of AoC. The Stack + Dynamic Programming approach to parse the Path only works if you assume that each subpath returns the branch point, that sounds like a massive assumption to me. I spent ages attempting to parse the path using a recursive descent parser to generate the maze (& still failed ðŸ˜).
Day 21 is back to Elf Assembly Language & the problem statement seems a bit vague which has not really lightened my mood.
k
karelpeeters
12/21/2018, 8:30 AM
Did the parsing not work or the generating-the-maze?
a
andyb
12/21/2018, 8:57 AM
It was the parsing, I failed to generate the Tree structure properly.
s
SiebelsTim
12/21/2018, 8:59 AM
I have written a recursive descent parser for it. My solution is posted above if you want to have a look.
a
andyb
12/21/2018, 9:00 AM
Ok, will check it out. Thanks
k
karelpeeters
12/21/2018, 9:11 AM
I've got one too, using a Queue instead of advancing the input yourself simple smile
s
SiebelsTim
12/21/2018, 9:12 AM
Yes, I've just checked out your solution. Much cleaner in my opinion 🙂. I just went braindead, simply writing the accept/expect functions I've written a few times already.
a
andyb
12/21/2018, 9:13 AM
Think I'm getting too old or tired for AoC this year. The last few days have fried my brain.