r/adventofcode • u/E-Meisterr • Dec 15 '24
Help/Question - RESOLVED [2024 day 15 part 2] Anything I’m missing?
I’m having the problem of ‘example works, real input doesn’t’ for the millionth time. I already checked that the boxes are only being moved if there aren’t any walls. Boxes aren’t being pushed inside each other as the amount of boxes at the start are the same as at the end. Is there anything I’m missing? Any example input that I can use to find something out?
EDIT: Github (A lot of code is there for debugging)
UPDATE: Solved the problem: There was a wrong square bracket somewhere in the code (']' in stead of '['). Found this using u/Jaiz0's input Thank you all for thinking along with me! The only help I now need is to edit the post tag
3
u/rjwut Dec 15 '24
The case that bit me was one box pushing two boxes that both push the same fourth box.
1
u/0x14f Dec 15 '24
Would be difficult to answer your question without looking at your code.
1
u/AdIcy100 Dec 15 '24
As robot pushes other boxes if anyone of the boxes makes contact with # the push is not valid. I had the same problem example work but I missed this case
2
u/[deleted] Dec 21 '24
Hi, don't know if this is still relevant or not, but I had the same issue and just solved it by using this input, drawing the map on paper, marking the boxes that should be moved up in the last move and then debugging my code to check if it moves the right boxes.
1
u/AutoModerator Dec 15 '24
Reminder: if/when you get your answer and/or code working, don't forget to change this post's flair to
Help/Question - RESOLVED. Good luck!I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/chad3814 Dec 15 '24
thanks for the link to u/Jaiz0's input, that is what fixed it for me too!
0
u/truncated_buttfu Dec 15 '24
Maybe check that you are calculating the score correctly, that was my initial mistake at least. A box pushed into the top left corner like this
has score 102, not 101.
0
u/[deleted] Dec 15 '24
[deleted] — view deleted comment
1
u/[deleted] Dec 15 '24
[removed] — view removed comment