I'm trying to display a array board for my tic-tac-toe game.
The board is supposed to look like this:
123
456
789
However when I run the program it shows up like this:
150
159
168
My Code:
class TicTacToe
{
public static void main(String[] args)
{
char [][] board = {{'1','2','3'}, {'4','5','6'}, {'7', '8', '9'}};
System.out.println(board[0][0] + board[0][1] + board[0][2]);
System.out.println(board[1][0] + board[1][1] + board[1][2]);
System.out.println(board[2][0] + board[2][1] + board[2][2]);
}
}