I currently have a 2d array of all '?', that displays like this:
? ? ?
? ? ?
? ? ?
I need to display the rows and columns, but I cannot figure out the correct way to do so. Can someone show me what to add to make it look like this:
0 1 2
0 ? ? ?
1 ? ? ?
2 ? ? ?
Below is the code I currently have to display just the '?'s
// initialize the contents of board
for ( int i = 0; i < board.length; i++){
for (int j = 0; j < board[i].length; j++){
board[i][j] = '?';
}
}
//Print board
for(int i = 0; i<board.length;i++)
{
for(int j = 0; j<board[0].length;j++)
{
System.out.print(board[i][j] +" ");
}
System.out.println();
}