| 12345678910111213141516171819202122232425 |
- namespace Day3;
- public record Point2D(int X, int Y)
- {
- public IEnumerable<Point2D> SurroundingAndSelf()
- {
- for (var y = -1; y < 2; y++)
- {
- for (var x = -1; x < 2; x++)
- {
- yield return new Point2D(X + x, Y + y);
- }
- }
- }
- }
- public abstract class Token
- {
- public Point2D Position { get; }
- protected Token(Point2D position)
- {
- Position = position;
- }
- }
|