예제 #1
0
 public static bool AreNeighbors(Coordinate c1, Coordinate c2) => Math.Abs(c1.Row - c2.Row) <= 1 && Math.Abs(c1.Column - c2.Column) <= 1;
예제 #2
0
 public static int Distance(Coordinate c1, Coordinate c2) => Math.Abs(c1.Row - c2.Row) + Math.Abs(c1.Column - c2.Column);