blairfrandeen / 2022-AoC

Wherein I pretend I learned anythign at all about programming int he last year
0 stars 1 forks source link

Not pre-splitting input causing redundant code #4

Open blairfrandeen opened 1 year ago

blairfrandeen commented 1 year ago

Example of redundancy: https://github.com/blairfrandeen/2022-AoC/blob/ff28f2615a8a9986d68be9e67e6a4784a6a474f0/src/day_4.rs#L8

Need to modify src/main.rs to return contents as a vector of string slices. This will require modification of all puzzles to date, so better sooner than later. This should also remove the last trailing newline or blank item.

Can't think of an AoC problem where working line by line from a text file wasn't a reasonable place to start. There was one last year where we were given a very simple string to start with (ended up with a gigantic number, maybe day 6?) and even then, it's just a single-element vector.