So, I’m currently at day 5, can I just hardcord th...
# advent-of-code
d
So, I’m currently at day 5, can I just hardcord the inputs only for stacks? 😅 Parsing the input seems to be a nightmare 👻 Edit: I parsed it
yes black 2
p
s/nightmare/fun
x
I found a fun way to do it. Basically you index where each numeral appear on line number 9 and use that indexes on the lines 8 → 0
c
It's not as hard as it looks: the box numbers are always in the same position, and are either a character or a space.
Just ignore the ascii-art parts and focus on what the data you need is and where it is
j
In AoC you can hardcode whatever you need if parsing turns out too time consuming for you. However, as mentioned above, the parsing is not that complicated in the end... 😉
d
Thanks a lot good people. I went the nightmare way (fun way 😜) and finally solved the problem It’s not an ideal way but it works 👐 Here is my solution: https://github.com/mddanishansari/advent-of-code-2022/commit/b73e09c6a5bebfacd4b177f495062e3288a3de54
For Day 05 actual solution was not that difficult but parsing the input itself was quite difficult.
j
yes, sometimes the input parsing needs more code than actual solution 🤷‍♂️