1.2 KiB

day 07 (oops, only 09!)

part 1

UwU finally something fun!

Writing the recursive bits weren't that hard; Debugging them to figure out why aren't they working is another thing. I spent a solid hour trying to debug my code completing correctly on the sample test data, and not on my chall; The total size was somehow way too small. It turned out that I've had an invalid string replace in handling the .. case in the recurse function. As long as a branch never further branched out (so, one directory continued through a path of more directories containing one or zero directories), it was all fine. Otherwise, pwd was set to two slashes, which broke Things.

i hate how I handled half of the code as a subshell, but I don't care enough about it to rewrite it now

Well! onto part 2...

part 2

Why the hecc did the 1st part deliberately instruct the programmer to count directories multiple times, and the 2nd part went "well, actually no, we want a proper size, not an imaginary size"???

thankfully, I have decided to write the parser code separate from the summing code, so I could just easily throw the 2nd part out while keeping the 1st part.

Anyways! that was probably the most fun chall here yet! Neat™!