SHOW:
|
|
- or go back to the newest paste.
1 | private void populatematrix(int min, int max) { | |
2 | Random randnum = new Random(); | |
3 | for (int r = 0; r < rows; r++) { | |
4 | for (int c = 0; c < columns; c++) { | |
5 | matrix[r][c] = min + randnum.nextInt(max - min + 1); | |
6 | } | |
7 | } | |
8 | } | |
9 | ||
10 | private void populatematrix(int[][] array) { | |
11 | Random randnum = new Random(); | |
12 | for (int r = 0; r < array.length; r++) { | |
13 | for (int c = 0; c < array[0].length; c++) { | |
14 | array[r][c] = -50 + randnum.nextInt(24 + 50 + 1); | |
15 | } | |
16 | } | |
17 | } |