My program doesn’t print anything at all.
First I initialized the board in a seperate class (board):
public class Board {
public char board[][] = new char[9][9];
public void main(char[] args){
for(int i=0; i<9; i++){
board[i][0] = '_';
board[i][8] = '_';
}
for(int h=0; h<9; h++){
board[0][h] = '|';
board[8][h] = '|';
}
for(int x=0; x>9; x++){
for(int y=0; y>9; y++){
System.out.println(board[x][y]);
}
}
}
}
Then called it in the main, with a PrintLine of “Hello World” to check that the code was being accessed. No errors are flagged up but neither does it print anything at all. The Main is below also just to check that i havent done anything simple and stupid:
public static void main(String[] args) {
Ticker T = new Ticker();
Board B = new Board();
for(int x=0; x>9; x++){
for(int y=0; y>9; y++){
System.out.println("Hello World");
System.out.print(B.board[x][y]);
Besides the incorrect condition in the for loops you should consider using
It fixes some problems
mainmethod with a constructor so the code you wrote there is executedNow if you do
you should see some board like thing