Zobrist Hash

class core.hash.ZobristHash(game_type: GameType)[source]

Bases: object

Zobrist Hash.

toggle_last_moved_piece(piece_index: int) None[source]

Toggles the hash part for the last moved piece, specified by its index.

Parameters:

piece_index (int) – Moved piece index.

toggle_piece(piece_index: int, position: Position, stack: int) None[source]

Toggles the hash part for the specified piece at the specified position and stack.

Parameters:
  • piece_index (int) – Moved piece index.

  • position (Position) – Moved piece position.

  • stack (int) – Moved piece elevation.

toggle_turn() None[source]

Toggles the hash part for the turn color.