hw1/src/main/java/models/GameBoard.java
/**
   * Lets a second player join the game, and starts the game.
   * @throws Exception A simple exception thrown if the game has already started
   *                   and has not ended.
   */
Lets a second player join the game, and starts the game.
@throws Exception A simple exception thrown if the game has already started
and has not ended.
Lets a second player join the game and starts the game . @throws Exception A simple exception thrown if the game has already started and has not ended .
public void joinGame() throws Exception {
    if (gameStarted && (winner != 0 || isDraw)) {
      throw new Exception("Game already started");
    }
    p2 = new Player(p1.getType() == 'X' ? 'O' : 'X', 2);
    gameStarted = true;
  }
public void joinGame ( ) throws Exception { if ( gameStarted && ( winner != 0 || isDraw ) ) { throw new Exception ( "Game already started" ) ; } p2 = new Player ( p1 . getType ( ) == 'X' ? 'O' : 'X' , 2 ) ; gameStarted = true ; }
Lets a second player join the game, and starts the game.
Lets a second player join the game and starts the game .