thanks for the code.
in setup: TicTacToeBoard board = new TicTacToeBoard();
must be board = new TicTacToeBoard();
(By repeating the type TicTacToeBoard you make a new, local variable
instead of making the global object “board”. Therefore, don’t repeat the type TicTacToeBoard)
Remark
You had a misplaced } here:
//Nested for loop to number the spaces of the board
for (int row = 0; row < dim; row++) {
for (int col = 0; col < dim; col++) {
spaces[row][col] = new TicTacToeSpace(row * (width / dim), col * (width / dim), width / dim, width / dim);
}
}
} // constr // this bracket (or line) was misplaced