I am writing a game code. The board of this game is 10x10 size. In the beginning, I wrote this board as a two-dimensional integer array. Now I have to replace some places on the board with letters. It will change with letters according to the coordinates entered by the player.
private static int[][] board = new int[10][10]; //board
StringBuilder sb = new StringBuilder();
for (int[] array : board) {
sb.append('\n').append(Arrays.toString(array));
}
String new = sb.toString(); //I tried to convert this way
if (new[x][y].equals("r")){
new[x][y] = "d"; //I'm getting an error in this part.
}