| 123456789101112131415 |
- namespace Day10;
- public record GridPoint(int X, int Y)
- {
- public GridPoint Add(GridPoint other)
- {
- return new GridPoint(X + other.X, Y + other.Y);
- }
- public int Distance(GridPoint other)
- {
- return Math.Abs(X - other.X)
- + Math.Abs(Y - other.Y);
- }
- }
|