|
Okay, not bad. First replace that last out call with System.out.println();. All you need is a linefeed there, and then it'll place each iteration on a line of its own.
The reduction is still off. Its the counter though, given what you have you need to subtract 22 - (i * 4) since you reduce by four during each iteration (two from the left, and two from the right). That should give you the correct result.
A future modification you could consider is handling this mathematically instead. So instead I want to filter down to nothing in only 4 rows instead of 6 rows. How many would I have to subtract per line in order to get to this result? And same idea with columns, I want to show 50 now and filter it down using only 5, so how many would I subtract from there. And so forth. So keep that in mind for a potential future modification for it.
|