Board.__init__(self, player_1, player_2, width=7, height=7)
Board width
Board height
Reference to a hashable object registered as a player with the initiative to move on the current board
Reference to a hashable object registered as a player awaiting initiative to move on the current board
Counter indicating the number of moves that have been applied to the game
Modify the game object by moving the active player on the game board and disabling the vacated square (if any). The forecast_move method performs the same function, but returns a copy of the board, rather than modifying the state in-place.
Return a new Board object that is a copy of the current game state
Equivalent to apply_move, but returns a copy of the board rather than modifying the state in-place.
Returns a list of tuples identifying the blank squares on the current board
Returns a list of tuples identifying the legal moves for the specified player
Returns the opponent of the specified player
Returns a tuple (x, y) identifying the location of the specified player on the game board, or None of the player is a registered agent in the game but has not yet been placed on the board. Raises a RuntimeError if the specified player is not registered on the board.
Return a hash of the current state (public alias of hash method). The hashed state includes occupied cells, current player locations, and which player has initiative on the board. An equivalent hash function can be added to the isolation.Board class from the isolation project:
Returns True if the specified player has lost the game in the current state, and False otherwise
Returns True if the specified player has won the game in the current state, and False otherwise
Returns True if the active player can legally make the specified move and False otherwise
Return a string representation of the current board position
Returns a floating point value: +inf if the specified player has won the game, -inf if the specified player has lost the game, and 0 otherwise.