/* static MatrixWeather rndTemp() * { * MatrixWeather weather; * if (day > 0 && month > 0) * { * weather = new MatrixWeather(day, month); * } * else weather = new MatrixWeather(); * return weather; * }*/ static int[,] rndArr(MatrixWeather weather) { int[,] Arr = weather.temperature; Random rnd = new Random(); for (int j = 0; j < Arr.GetLength(0) - 1; j++) { for (int i = 0; i < Arr.GetLength(1) - 1; i++) { Arr[i, j] = rnd.Next(1, 20); } } return(Arr); }
public static MatrixWeather creating(int day, int month) { MatrixWeather weather; if (day > 0 && month > 0) { weather = new MatrixWeather(day, month); } else { weather = new MatrixWeather(); } weather.temperature = rndArr(weather); return(weather); }