namespace Day17; public record struct Vec { public int X { get; } public int Y { get; } public Vec(int x, int y) { X = x; Y = y; } public Vec RotatePositive() { // clockwise return new Vec(-1 * Y, X); } public Vec RotateNegative() { // counter-clockwise return new Vec(Y, -1 * X); } public Vec Add(Vec other) { return new Vec(X + other.X, Y + other.Y); } public char Arrow() { if (Y == 0) { return X > 0 ? '>' : '<'; } else { return Y > 0 ? 'v' : '^'; } } }