feat: work on day 15 part 1

This commit is contained in:
Stevan Freeborn
2024-12-16 14:28:09 -06:00
parent 02ab20eeaa
commit c5e8ebbf22
3 changed files with 186 additions and 10 deletions
+5 -5
View File
@@ -1,9 +1,9 @@
namespace HoofIt;
record Direction(int XD, int YD)
record Direction(int Xd, int Yd)
{
public static Direction Up = new(0, -1);
public static Direction Down = new(0, 1);
public static Direction Left = new(-1, 0);
public static Direction Right = new(1, 0);
public static readonly Direction Up = new(0, -1);
public static readonly Direction Down = new(0, 1);
public static readonly Direction Left = new(-1, 0);
public static readonly Direction Right = new(1, 0);
}
+2 -2
View File
@@ -4,8 +4,8 @@ record Position(int X, int Y, int Height)
{
public bool TryGetNextPosition(Direction direction, string[] grid, out Position nextPosition)
{
var x = X + direction.XD;
var y = Y + direction.YD;
var x = X + direction.Xd;
var y = Y + direction.Yd;
nextPosition = new(x, y, -1);