My repository for my solutions for 2023's Advent of Code (https://adventofcode.com/). It is an advent calendar of programming problems. Problem descriptions have been copied into READMEs for convenience. They are not mine and belong to Advent of Code.
Learning how to implement regex in C#.
Further practise with regex. Using xUnit to implement tests for Day 1. Used xUnit as part of development for Day 2, testing each element as it was made before proceeding.
Day 3 - Parsing a grid of characters to identify larger numbers within and proximity to specific symbols
Test-driven development where tests are created before the implementation helped my understanding of the problem and each stage. Used MemberData in xUnit to allow for more complext test data.
Day 4 - Parsing strings to identify sets of numbers and performing calculations based on the intersections
More test-driven development helped with the process. Made progress in secure increments and was confident in my code. More complex regex patterns, so more good practise. Using sets and intersections to find crossover between numbers.
Day 5 - Parsing strings to identify sets of numbers which define arithmetic functions applied to specific ranges of numbers. Processing numbers through these functions.
Testing is such a stress relief. Instead of processing each number in a large range, can instead work with the limits of the range instead. More practice with regex.
Unit tests narrowed the problem when debugged, making development easier. More regex.
Test-driven development making development calmer, and easier to debug. More regex. Implementing IComparable with custom CompareTo.
Day 8 - Parsing series of crossroads with left and right turn options that lead to further crossroads, finding steps from start point to destination
Regex, Dictionaries, Prime factorization, Lowest Common Multiples. If the only option is a bruteforce which is taking too long, assumptions need updating.
Regex, stacks.
Day 10 - Determinining connectivity of nodes on a grid based on their symbols, traversing the grid to find loops of symbols, and unreachable elements.
Flood-fill algorithm, queues, 2D arrays, breadth-first search.
Cartesian coordinates.