I\'m a novice in java and I\'m a little bit of trouble trying to get the output I need. I\'m trying to make a Diamond outline pattern using nested loops in java. The output I ne
You were close enough, just some small changes
public static void drawDiamond(int n) {
int spaces = n - 1;
for (int i = 0; i < 2 * n - 1; i++) {
for (int j = 0; j < spaces; j++)
System.out.print(" ");
System.out.print(n - spaces);
for (int j = 0; j < (2 * n - 2 * spaces - 3); j++)
System.out.print(" ");
if (i != 0 && i != 2 * n - 2)
System.out.print(n - spaces);
if (i < ((2 * n) - 1) / 2)
spaces--;
else
spaces++;
System.out.println();
}
}