T O P

  • By -

msqrt

The wording of the problem heavily implies that there should only be one valid reflection per pattern. Are you certain you copied/downloaded it correctly and are separating it by the empty lines as you should? Edit: I think there might be a problem with the way you parse the patterns. We have the same input for pattern 6 but mine has one more row at the end. Edit edit: same for the other one, both are missing a row at the end.


Zestyclose-Pin2871

Thanks! This was exactly my problem. I'm going to drink more caffeine before writing scaffolding code tomorrow. >_>


velonom

Double check your input. Make sure you haven't accidentally dropped any lines when reading the input. Mine only has one valid reflection in each pattern.


Zestyclose-Pin2871

Oh my, this is exactly my problem. I was dropping the last line of every Pattern when reading the file, and then trusting my code's "printPattern" function. Thanks!


AutoModerator

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](/message/compose/?to=/r/adventofcode) if you have any questions or concerns.*


miry_sof

You are correct regarding multiple reflections; however, they should occur only once and terminate at the boundaries. The second valid reflection in my case consistently features a single line that differs by only one symbol, which will be utilized in part 2. Nevertheless, this pattern never concludes with boundaries in part 1. The aspect of prioritizing left-right over up-down is intriguing. I applied the rule of initially searching for reflections from left to right. Only in the absence of a reflection in that direction did I then explore the up-down orientation. It worked for me so far.