(self)
Restores the starting position.
Restores the starting position.
Restores the starting position .
def reset(self):
        """Restores the starting position."""
        self.pawns = BB_RANK_2 | BB_RANK_7
        self.knights = BB_B1 | BB_G1 | BB_B8 | BB_G8
        self.bishops = BB_C1 | BB_F1 | BB_C8 | BB_F8
        self.rooks = BB_A1 | BB_H1 | BB_A8 | BB_H8
        self.queens = BB_D1 | BB_D8
        self.kings = BB_E1 | BB_E8

        self.occupied_co = [ BB_RANK_1 | BB_RANK_2, BB_RANK_7 | BB_RANK_8 ]
        self.occupied = BB_RANK_1 | BB_RANK_2 | BB_RANK_7 | BB_RANK_8

        self.occupied_l90 = BB_VOID
        self.occupied_l45 = BB_VOID
        self.occupied_r45 = BB_VOID

        self.king_squares = [ E1, E8 ]

        self.ep_square = 0
        self.castling_rights = CASTLING
        self.turn = WHITE
        self.ply = 1
        self.half_moves = 0

        for i in range(64):
            if BB_SQUARES[i] & self.occupied:
                self.occupied_l90 |= BB_SQUARES_L90[i]
                self.occupied_r45 |= BB_SQUARES_R45[i]
                self.occupied_l45 |= BB_SQUARES_L45[i]

        self.half_move_stack = [] #collections.deque()
        self.captured_piece_stack = [] #collections.deque()
        self.castling_right_stack = [] #collections.deque()
        self.ep_square_stack = [] #collections.deque()
        self.move_stack = []
def reset ( self ) : self . pawns = BB_RANK_2 | BB_RANK_7 self . knights = BB_B1 | BB_G1 | BB_B8 | BB_G8 self . bishops = BB_C1 | BB_F1 | BB_C8 | BB_F8 self . rooks = BB_A1 | BB_H1 | BB_A8 | BB_H8 self . queens = BB_D1 | BB_D8 self . kings = BB_E1 | BB_E8 self . occupied_co = [ BB_RANK_1 | BB_RANK_2 , BB_RANK_7 | BB_RANK_8 ] self . occupied = BB_RANK_1 | BB_RANK_2 | BB_RANK_7 | BB_RANK_8 self . occupied_l90 = BB_VOID self . occupied_l45 = BB_VOID self . occupied_r45 = BB_VOID self . king_squares = [ E1 , E8 ] self . ep_square = 0 self . castling_rights = CASTLING self . turn = WHITE self . ply = 1 self . half_moves = 0 for i in range ( 64 ) : if BB_SQUARES [ i ] & self . occupied : self . occupied_l90 |= BB_SQUARES_L90 [ i ] self . occupied_r45 |= BB_SQUARES_R45 [ i ] self . occupied_l45 |= BB_SQUARES_L45 [ i ] self . half_move_stack = [ ] #collections.deque() self . captured_piece_stack = [ ] #collections.deque() self . castling_right_stack = [ ] #collections.deque() self . ep_square_stack = [ ] #collections.deque() self . move_stack = [ ]