I have this method that when called:
- (void)showContent
{
NSLog(@" 0 1 2 3 4 5 6");
for (int j = 0; j < rows; j++) {
for (int k = 0; k < columns; k++) {
MDLog(@"[%c]", board[j][k]);
}
NSLog(@"");
}
NSLog(@"---------------------------------------------------");
}
That's supposed to create an empty 6 x 7 grid (for a game of Connect Four) that looks like this:
0 1 2 3 4 5 6
[ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ]
---------------------------------------------------
However, the Xcode console doesn't print it that way at all. It displays each column vertically on top of one another. Other useful info is I have
int rows; // initializes to be 6
int columns; // initializes to be 7
char board[6][7];
Xcode prints it this way:
0 1 2 3 4 5 6
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
---------------------------------------------------