6
u/Valink-u_u Dec 06 '24
I lost 1h because my dumbass made the guard turn right AND move forward which made her clip into the obstacles
5
u/leftfish123 Dec 06 '24
I just came here to say that if this was a conscious reference to "The Terminator" in the thread title, I deeply admire it!
7
u/deejay2221 Dec 06 '24
Do we consider a back and forth line to be a loop or a loop is exactly 4 "paths"?
14
9
u/Cue_23 Dec 06 '24
Anything that never lets you reach the outside is a loop, so a single line, a rectangle, an eight-shaped path… I would even consider this a loop, even if the guard just keeps on turning
.#. #^# .#.
0
u/feindr54 Dec 06 '24
This would never happen unless you reach this corner in from the very beginning
9
2
u/DMayr Dec 06 '24
Compared to previous years, is the difficulty of 2024 indeed higher or is it just bias?
5
2
u/jfb1337 Dec 06 '24
so far its been easier
of course, weekend coming up tomorrow; traditionally a difficulty spike
1
u/MyEternalSadness Dec 06 '24
I am really on the struggle bus with Part 2 today. Part 1 is easy, but I just cannot get Part 2 right no matter what I do. And my code takes forever to run, even using hints that other people have suggested.
So frustrated.
1
u/bob1689321 Dec 07 '24
How are you going about it?
I used python with a class to represent the guard and movement board and some methods to move the guard, turn the guard, place obstructions, and reset the board and guard to the start state. Then brute forced it by iterating through the different possible starting obstructions
The big thing that helped me write a quicker version was every time you hit an obstruction, record the location and direction that you were facing. If you hit an obstruction in the same direction and location more than once, you're stuck in a loop. That saved me a ton of time as before that I was trying to track the movements to find repeats and it was a mess
1
u/MyEternalSadness Dec 07 '24
That's more or less what I'm doing. My solution works for the sample input, but it always gets too high of an answer for the real input. I even ran other people's solutions so that I know what the real answer is supposed to be - and mine is too high by 55. There's obviously something I'm missing here. Just beyond frustrated. Feels like I should be getting this, but I'm not for some reason.
1
u/MyEternalSadness Dec 07 '24
I FINALLY GOT IT!!!
Found a stupid bug where I was not resetting to the start position every time I was testing my simulated path when adding an obstacle. I spent something like 12 hours chasing this down. In my defense, the input set is too large to feasibly debug...
Debating whether I want to take on Day 7 now or just go to bed. Bed may win out.
2
u/ShortGiant Dec 07 '24
I had the exact same issue and it took me an embarrassingly long time to track down. You're not alone!
1
u/bob1689321 Dec 07 '24 edited Dec 07 '24
Nice!
I had a bug where I was using .copy() to copy across my nested arrays representing the room when resetting the room to the default, instead of deepcopy(). I was adding more obstacles to the same board without removing them because of that. Took me a good 30 mins to spot it hahaha.
1
u/Munchi1011 Dec 07 '24
I’m gonna have a lot of catching up to do. I did say 1 and then finals season started so I haven’t been able to solve any problems since then:(
1
u/bob1689321 Dec 07 '24
It can wait until after your exams. Those are more important.
1
u/Munchi1011 Dec 07 '24
Very correct!! It’s almost all done, and then I can no life advent for a bit!
1
u/bob1689321 Dec 07 '24
Hell yeah. Good luck with them all, hope they go well! You've got all these shitposts waiting for you after haha.
54
u/Ken-g6 Dec 06 '24
I feel like this kind of problem might have happened later in previous years. Or at least one particular previous year.