(int n)
| 14 | // 4 3 3 3 3 3 3 3 4 |
| 15 | // 4 4 4 4 4 4 4 4 4 |
| 16 | static void pattern9(int n) { |
| 17 | int originalN = n; |
| 18 | n = 2 * n; |
| 19 | for (int row = 0; row <= n; row++) { |
| 20 | for (int col = 0; col <= n; col++) { |
| 21 | int atEveryIndex = originalN - Math.min(Math.min(row, col), Math.min(n - row, n - col)); |
| 22 | System.out.print(atEveryIndex + " "); |
| 23 | } |
| 24 | System.out.println(); |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 |