Let's see if my legs still work tomorrow.
Let's see if my legs still work tomorrow.
I used a modified A* algorithm that keeps track of all the previous states that have the same cost to get to the current state.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
github.com/TheEadie/adv...
I used a modified A* algorithm that keeps track of all the previous states that have the same cost to get to the current state.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
github.com/TheEadie/adv...
After some delay I'm back looking at these problems. Turns out recursion was the way to get this working and not the clever code I wrote for part 1. Some annoying edge cases for left/right too.
#AdventOfCode #CSharp #DotNet
github.com/TheEadie/adv...
After some delay I'm back looking at these problems. Turns out recursion was the way to get this working and not the clever code I wrote for part 1. Some annoying edge cases for left/right too.
#AdventOfCode #CSharp #DotNet
github.com/TheEadie/adv...
Christmas partying over
Christmas partying over
I got lucky with a hunch in part 2 that the Easter egg might be when all the robots weren't overlapping.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
I got lucky with a hunch in part 2 that the Easter egg might be when all the robots weren't overlapping.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
Took me far too long to remember the maths I needed to get the answer today. Also came unstuck by trying to use my coordinate record which uses ints rather than longs.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
Took me far too long to remember the maths I needed to get the answer today. Also came unstuck by trying to use my coordinate record which uses ints rather than longs.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
Flood fill to the rescue. Part 2 took some time to get to a working solution.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
Flood fill to the rescue. Part 2 took some time to get to a working solution.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
Even though I saw part 2 coming a mile away I still wrote the naive implementation for part 1 first.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
Even though I saw part 2 coming a mile away I still wrote the naive implementation for part 1 first.
#AdventOfCode #CSharp #dotnet
github.com/TheEadie/adv...
Accidentally solved part 2 before part 1 today. Simple breadth first search.
github.com/TheEadie/adv...
Accidentally solved part 2 before part 1 today. Simple breadth first search.
github.com/TheEadie/adv...
My first use of an infinite loop and yield returns this year.
github.com/TheEadie/adv...
My first use of an infinite loop and yield returns this year.
github.com/TheEadie/adv...
Some depth first search and an early return when going over the target number. Could probably just be recursion since the depth of calls is quite low.
github.com/TheEadie/adv...
Some depth first search and an early return when going over the target number. Could probably just be recursion since the depth of calls is quite low.
github.com/TheEadie/adv...
I thought the solution to one of the parts would cause me to run out of memory so I modelled it as "zones". Would have been much easier with an array and pointers.
github.com/TheEadie/adv...
I thought the solution to one of the parts would cause me to run out of memory so I modelled it as "zones". Would have been much easier with an array and pointers.
github.com/TheEadie/adv...
I spent far too long checking if turning right at the current step would result in a loop and failing to get the right answer. I chucked it all away and did a brute force over the spaces in part 1.
github.com/TheEadie/adv...
I spent far too long checking if turning right at the current step would result in a loop and failing to get the right answer. I chucked it all away and did a brute force over the spaces in part 1.
github.com/TheEadie/adv...
Custom implementation of `IComparer` makes this quite simple.
#AdventOfCode #CSharp
github.com/TheEadie/adv...
Custom implementation of `IComparer` makes this quite simple.
#AdventOfCode #CSharp
github.com/TheEadie/adv...
Once again using a dictionary of coordinates to prevent complicated bound checks.
#AdventOfCode #CSharp
github.com/TheEadie/adv...
Once again using a dictionary of coordinates to prevent complicated bound checks.
#AdventOfCode #CSharp
github.com/TheEadie/adv...
Regex to the rescue. Also resisted turning part 2 into an unreadable aggregate.
github.com/TheEadie/adv...
Regex to the rescue. Also resisted turning part 2 into an unreadable aggregate.
github.com/TheEadie/adv...
This article saved my sanity: www.metageek.com/training/res...
This article saved my sanity: www.metageek.com/training/res...