In terms of debugging, the most common issues are around overwriting a cell you shouldn't have. Consider setting up validation steps that run each time you run an instruction. For example, validate that you have the same number of walls and boxes after each run. If you successfully move the boxes up or down, validate that the sum of heights across all boxes in the grid have increased our decreased by the amount you expect. You can define many validations like this. Good luck!
3
u/[deleted] Dec 15 '24
I can't thank you enough dude, this saved me so much headache!
3
u/chad3814 Dec 15 '24
This is what I came to reddit for! Unfortunately my code solves this (and the examples on page) correctly, but not the input.
1
u/ash30342 Dec 15 '24
Thanks! This was exactly the example I needed to fix my program!
1
u/GrGadget Dec 15 '24
My code passes the example given, so I thought i'd give in and try this... it passes this too but not the full input
1
u/Not_puppeys_monitor Dec 15 '24
Many more test inputs in thread https://www.reddit.com/r/adventofcode/comments/1heoj7f/2024_day_15_part_2_more_sample_inputs_to_catch/
1
u/Less_Jackfruit6834 Dec 16 '24
It working! just missed one if to check both sides of box for wall XD
1
u/cjn566 Dec 16 '24
Looks like your 'linting' commit overwrote the test case with the original sample from AoC. I was very confused for a minute.
0
u/[deleted] Dec 15 '24
[deleted] — view deleted comment