Class GoMokuBoard

    • Constructor Detail

      • GoMokuBoard

        public GoMokuBoard​(int numRows,
                           int numCols)
        Constructor
        Parameters:
        numRows - num rows
        numCols - num cols
      • GoMokuBoard

        public GoMokuBoard()
        default constructor
      • GoMokuBoard

        protected GoMokuBoard​(GoMokuBoard pb)
    • Method Detail

      • getMaxNumMoves

        public int getMaxNumMoves()
        Description copied from interface: IRectangularBoard
        There can be no more than this many moves in a game In many games, it is not just the number of squares. the main purpose of this function is to avoid cases where a game can go on forever by making repeat moves.
        Returns:
        upper limit on the number of moves that the board can support
      • undoInternalMove

        protected void undoInternalMove​(TwoPlayerMove move)
        For gomoku, undoing a move is just changing that space back to a blank.
        Specified by:
        undoInternalMove in class Board<TwoPlayerMove>
        Parameters:
        move - the move to undo
      • getNumPositionStates

        public int getNumPositionStates()
        Num different states. This is used primarily for the Zobrist hash. You do not need to override if yo udo not use it. States: player1, player2, empty.
        Specified by:
        getNumPositionStates in class TwoPlayerBoard<TwoPlayerMove>
        Returns:
        number of different states this position can have.