Welcome

It is that time of year. The Advent of Code is upon us. This site will attempt to show Craig's progress through the ever increasingly tough piuzzles. How far can he get? Only time will tell. It is hoped he won't make an ass out of himself. Test.


Day One

A simple adding of list data. Nothing to write home about. I just iterated through the data adding up each line to a running total. Once a blank was detected the total was compared and inserted into a list. The first part wanted to know about the maximum value. SImple enough, just sort the list and take the last one. Part two wanted the total of the top three values. Using the sorted list again, just add the last three.

I finished up in 14:22. That was good enough for 5,284th place. Awesome.


Day Two

The classic Rock, Paper, Scissors game with a twist. Some odd scoring rules made the first round a bit more complex than it really needed to be. Round two threw in a monkey wrench. The data changed from both persons moves to the first person's move and then a code for it the second person was to win, lose or draw. That made for an interesting code challenge. I chose to codify the rules for both parts into dictionaries with multipart variables. Clean code but needs comments to follow.


Day Three

So a simple matching task today. Which characters in a string match? I went for some brute force and just hammered it out. To make it more interesting I used variable parameters in an extension method to make it handle any number of string. You know, just to make it more fun.


Day Four

Today was all about the logic statements. Do two numeric sequences overlap? The first part was if they were totally overlapping. That is simply determining if one sequence starting number is greater than or equal to the other one and if the ending sequence is less than the other one.

Part two was to determine any overlap. I just used the first part to resolve that case. The other cases are offset to the left (less than) and offset to the right (greater than). Logic was easy enough when you write it out.