/** A tic-tac-toe game. */
public class TicTacToe {
  
  /** The tic-tac-toe board. */
  private char[][] board;
  
  /** The board dimension. */
  // This is a constant.  Once it has been initialized
  // it cannot be reassigned.
  private static final int BOARD_SIZE = 3;
  
  /** The blank square. */
  private static final char BLANK_SQUARE = ' ';
    
  /** Create a new tic-tac-toe game. */
  public TicTacToe() {
    this.board = new char[BOARD_SIZE][BOARD_SIZE];
    
    for (int i = 0; i < BOARD_SIZE; i++) {
      for (int j = 0; j < BOARD_SIZE; j++) {
        this.board[i][j] = BLANK_SQUARE;
      }
    }
  }
  
  /**
   * Put mark m at row r and column c.
   * 
   * @param m The mark to put on the board.
   * @param r The index of the row.
   * @param c The index of the column.
   */ 
  public void setMark(char m, int r, int c) { 
    if (this.board[r][c] == BLANK_SQUARE) {
      this.board[r][c] = m;
    }
  } 
}