Commit Graph

6 Commits

Author SHA1 Message Date
41f0d167e4 Report more accurate timings
The string colorizer is slow (but apparently only the first time it runs, for some reason?), printing can be slow, who knows what else the framework is doing, etc., so manually inserting Stop()s exactly where we want the timings to stop is the most reliable way to handle this. I like the elegance of the disposable solution, but my goal here is to measure the actual algorithm, not anything else.

A slightly restructuring would make it so I don't have to do this; if main.cs was receiving a string from Part1 and Part2 instead of having each day individually print its own results, we could scope timings to exclude any console writing. But whatever.

I also went ahead and made 17 only run once since I was using the same result to answer part 1 and 2. I've since discovered that part 1 is far simpler and can be found without solving the entire problem space, but whatever.
2021-12-17 10:57:33 -06:00
13cc275842 Expand color code support
Because @tocchan had such a better implementation than me.
2021-12-16 16:06:27 -06:00
ddf758951e Add ability to pipe input from a file
I'm sure there's a better way to strip the UTF-8 BOM from the beginning of the file (and/or use that information to actually handle the string appropriately) but this works for my use case. At this point, we support ASCII and UTF-8 in LE order with or without the byte-order mark and, I think, either \n or \n\r line endings as input text file formats.
2021-12-13 12:14:48 -06:00
fe2d276115 Add colors and stuff
Because I think it's neat. Ref: https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html
2021-12-13 12:14:48 -06:00
9e7942a35e Enable running all days at once
I'm kinda bored and wanted to.
2021-12-12 15:28:41 -06:00
2c224483b4 Day 9 solution
As always, plenty of room for improvement, but I'm reasonably satisfied with the core implementation. I'm honestly not sure why the Distinct is needed in the GetBasinSize() result as it's supposed to not even add the point if the point is already in there, but it's late so I'll check that out later.
2021-12-09 00:40:02 -06:00