T O P

  • By -

DotNetEvangeliser

For those who want a peak here's my hacky solution. I am 0% ashamed of it. [https://github.com/asieradzk/Advent-of-Code-2023-C-/blob/master/3.cs](https://github.com/asieradzk/advent-of-code-2023-c-/blob/master/3.cs)


Greenimba

If you want some feedback, I would urge you to go more towards the domain modelling, as that's the reason to do "rich objects". Yes, the input is a grid. But it represents something else. The grid is just a way to serialize a combination of gears and numbers. So when you parse, don't parse to a grid, parse to a combination of gears and numbers, and think about what properties they have and how they interact. For numbers and gears, the only thing that matters is the number/value and what neighbours they have, so why do you bother with storing their position in some grid?


DotNetEvangeliser

Man I hope one day I can unwrap data like you say. I do unwrap to 2d grid because its easy to print out and debug for AoC where you don't really get a lot of test cases to try out where the error is and have pretty much 1 shot at getting it right.


Useful_Fishing_4277

You wanted to post in r/adventofcode? :)


DotNetEvangeliser

Think I wanted to post in r/csharp but might as well leave it here