In Python, typically to define said game board I would have used the following code:
board = [['0','0','0','0','0','0','0','0','0','0'] for i in range(10)]
However, using Java the only way I have been able to find so far to produce the same result would be to do:
public static String[][] board = {
{"0","0","0","0","0","0","0","0","0","0"},
{"0","0","0","0","0","0","0","0","0","0"},
{"0","0","0","0","0","0","0","0","0","0"},
{"0","0","0","0","0","0","0","0","0","0"},
{"0","0","0","0","0","0","0","0","0","0"},
{"0","0","0","0","0","0","0","0","0","0"},
{"0","0","0","0","0","0","0","0","0","0"},
{"0","0","0","0","0","0","0","0","0","0"},
{"0","0","0","0","0","0","0","0","0","0"},
{"0","0","0","0","0","0","0","0","0","0"}};
Surely there must be a more efficient way of doing this. I know I can do it efficiently if it were to be integers, but it has to be strings given the situation. I had thought a for loop would also have applied, but I can't seem to find the right syntax for it; perhaps it isn't applicable for Java. Are there any suggestions?