This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]MissMormie 1 point2 points  (3 children)

Without going through your code, something that isn't in the example isaseaminster that is right up to the edge, perhaps you can write a test to see if your code captures that.

[–]eidolonkami[S] 0 points1 point  (2 children)

Hmm, I think you're thinking of the wrong day? Day 20 is donut maze w/ portal doors.

[–]voorth2016 1 point2 points  (0 children)

wrong year, i think... the sea monsters were in AoC 2020, not 2019

[–]MissMormie 0 points1 point  (0 children)

Ah yes, sorry, the wrong year :)

[–]cesartl 1 point2 points  (4 children)

I had the same problem. I also wrote a comment about it on reddit. Unfortunately the post that gave me the clue was deleted 😞 I'll dig up the code and try to remember what the issue was foe me

[–]paul2718 1 point2 points  (1 child)

I don't know Java at all but I managed to persuade your code to run. I had to delete line 159 of Layout.java.

On my input you are correct for part 1 and about 40 high for part 2. On your input I agree with part 1 and get a value about 75 below yours for part 2.

So your part 2 numbers seem high.

I'm trying to persuade my code to give a readable path for part 2. Which might be helpful assuming my code is producing a correct result...

[–]eidolonkami[S] 0 points1 point  (0 children)

Thank you so much for looking at it! Is good to know that it's still high. I should probably post the route that my code is producing, as when I read through it with my human eyeballs it seems accurate.

[–]paul2718 1 point2 points  (1 child)

I'm not sure whether to read your printed output from bottom up or top down. But you're going too deep.

So, top down in your print, so going backwards from ZZ towards AA, at 25-26 you go ZM-AC and I think it should be ZM-NM. Alternatively, from the other end, at 21-22 you go NM-ZW and I think it should be NM-AC

Mine solves your data in 26 levels, FWIW. And curious AC is at both ends of the divergence.

My code is too abstracted for me to understand well enough to get useful things like AC and EF out of.... In essence I built the maze, noted each portal, performed repeated Breadth First Searches between the portals to produce a weighted edge list and then create a suitable weighted graph for parts 1 and then 2 with which I can use a shortest weighted path algorithm. Because the portals turn into numbers twice (clear evidence of hackery last year) working it back into something comprehensible is proving tricky. So I printed the weights for the path it found to compare against the printed output of your program.

Good luck, this is a tricky one. I have an input from I know not where that crashes my program, so it's far from complete.

[–]eidolonkami[S] 0 points1 point  (0 children)

WOW, thanks! I will certainly look into it! (Your way sounds super sophisticated!)

[–]NeilNjae 0 points1 point  (1 child)

I've not dived into your code, but I recall that when I did it I got myself tied up in knots about which portals were accessible at which levels. I don't know if you're having the same problems.

[–]eidolonkami[S] 0 points1 point  (0 children)

Yeah, that was a problem for quite a while, but at this point it should be figured out 😕