public static double Average_Num_Cells_ReachableWithinSteps(this PM_Maze maze, int numSteps) { int width = maze.Q_Width(); int height = maze.Q_Height(); int sum = 0; for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { sum += maze.Cell__NumCellsReachable_WithinSteps(new Vec2i(x, y), numSteps); } } return((double)sum / (double)maze.NumCells__All()); }