engine.py
def possible_moves(self, game_state, from_position):
        """Return all moves except from castlings that this king can make if it's
        located at from_position, including putting itself into check and capturing the
        opponents king.
        """
        capture_move_list = []
        non_capture_move_list = []
        for to_position in self.possible_moves_dict[from_position]:
            piece = game_state.board[to_position]
            if piece:

                # If there is an opposite color piece on the target square.
                if piece.white != self.white:
                    move = Move()
                    move.add_change(from_position, self, None)
                    move.add_change(to_position, piece, self)
                    capture_move_list.append(move)

            # If the is no piece on the target square.
            else:
                move = Move()
                move.add_change(from_position, self, None)
                move.add_change(to_position, None, self)
                non_capture_move_list.append(move)

        return (capture_move_list, non_capture_move_list)
Return all moves except from castlings that this king can make if it's
        located at from_position, including putting itself into check and capturing the
        opponents king.
        
Return all moves except from castlings that this king can make if it's
located at from_position, including putting itself into check and capturing the
opponents king.
Return all moves except from castlings that this king can make if it ' s located at from_position including putting itself into check and capturing the opponents king .
def possible_moves(self, game_state, from_position):
        capture_move_list = []
        non_capture_move_list = []
        for to_position in self.possible_moves_dict[from_position]:
            piece = game_state.board[to_position]
            if piece:
                if piece.white != self.white:
                    move = Move()
                    move.add_change(from_position, self, None)
                    move.add_change(to_position, piece, self)
                    capture_move_list.append(move)
            else:
                move = Move()
                move.add_change(from_position, self, None)
                move.add_change(to_position, None, self)
                non_capture_move_list.append(move)
        return (capture_move_list, non_capture_move_list)
def possible_moves ( self , game_state , from_position ) : capture_move_list = [ ] non_capture_move_list = [ ] for to_position in self . possible_moves_dict [ from_position ] : piece = game_state . board [ to_position ] if piece : if piece . white != self . white : move = Move ( ) move . add_change ( from_position , self , None ) move . add_change ( to_position , piece , self ) capture_move_list . append ( move ) else : move = Move ( ) move . add_change ( from_position , self , None ) move . add_change ( to_position , None , self ) non_capture_move_list . append ( move ) return ( capture_move_list , non_capture_move_list )
Return all moves except from castlings that this king can make if it's
located at from_position, including putting itself into check and capturing the
opponents king.
Return all moves except from castlings that this king can make if it ' s located at from_position including putting itself into check and capturing the opponents king .
"""Return all moves except from castlings that this king can make if it's
        located at from_position, including putting itself into check and capturing the
        opponents king.
        """ # If there is an opposite color piece on the target square. # If the is no piece on the target square.
self
game_state
from_position