private static bool ValidCell(int x, int y, MatrixField matrix) { if (x >= 0 && x < matrix.GetLengthX() && y >= 0 && y < matrix.GetLengthY()) { return(true); } return(false); }
private static void InitializeMatrix(MatrixField matrix) { int value = 0; for (int i = 0; i < matrix.GetLengthX(); i++) { for (int j = 0; j < matrix.GetLengthY(); j++) { matrix[i, j] = value++; } } }