Commit Graph

15 Commits

Author SHA1 Message Date
a3b906f94d Day 6 solution 2022-12-05 23:28:34 -06:00
b9161e4b42 Day 5 solution
A Deep Copy and a double-ended queue would have made this day much easier. I should add those. (Having trouble finding a generic deep copy that works in .net 6, though...I opted to rewrite my original List<List<char>> solution into List<string> in lieu of a deep copy so I wouldn't have to parse the input all over again.)
2022-12-04 23:46:24 -06:00
4b51ff9970 Day 4 solution 2022-12-04 00:47:34 -06:00
3fc0340738 Appease Rider's inspections
The list is finally clear.
2022-12-03 08:58:26 -06:00
771a21b969 Day 3 solution
Took me a bit to remember how Aggregate worked, as it always does when I need it.
2022-12-03 08:57:51 -06:00
89484e1a0a Add more files that Rider created 2022-12-01 23:14:58 -06:00
ff7633dc12 Day 2 solution
This is an ugly, kind-of-brute-force solution. I'm not proud of it, but it works and got me top 1000 on both parts.

I also changed the "which day to run if no day is specified" to just always choose the highest numbered day.
2022-12-01 23:14:45 -06:00
483f1f2502 Strip more BOMs
The 01a sample text file I created in VS2022 has a big-endian utf-16 byte order mark in front. When read with File.Read* methods it was fine, but when piped in from the command line it was causing the integer parsing to fail due to the extra bytes on the front. This is the cleanest way I can find to strip any of a set of BOMs from a string. Maybe there's an easier way somewhere, but the main issue is that using something like line[0..1].SequenceEqual() may or may not use wide chars (0xFEFF as opposed to 0xFE, 0xFF, for example) so I can't just build a list of preamble arrays and check if the byte version of the string starts with them.

The "StripPreamble" character list is still a mystery. I found it while working on my Macbook for aoc2021 and can't seem to find any search results indicating what these bytes represent, so...just gonna leave it there.
2022-12-01 11:59:43 -06:00
c1757500da Sample input for day 1 2022-12-01 08:48:36 -06:00
e2c78ecc45 Day 1 solution 2022-12-01 07:17:05 -06:00
756d8e519a Don't process twice if the file exists on disk 2022-11-30 20:40:00 -06:00
22c89a7e0e Apply a few more Rider suggestions 2022-11-30 20:38:03 -06:00
55f8a1806c Embed inputs as resources
This enables the binary to be invoked from anywhere and still run on the default input set, as well as being more portable/shareable which can help with performance comparisons between machines. Files are still supported if they exist.
2022-11-30 20:37:36 -06:00
d725a9e52e Add Rider files, apply Rider suggestions 2022-11-30 17:39:40 -06:00
23945154d4 Initial commit - framework 2022-11-30 17:19:53 -06:00