src/quagen/ai/biased.py
def _calculate_opponent_gain(self, spot):
        """
        Calculates the average gain in projected scoring for each opponent if
        the opponent were to go in the passed spot.

        Args:
            spot: (x, y) spot to evalulate

        Returns:
            (int) Average projected gain for opponents' moving in the spot.
        """
        gain = 0
        player_count = self._game.settings["player_count"]

        for color in range(1, player_count + 1):

            # Only calculate projection for opponent colors
            if color != self._color:

                # The current projected score for the color
                current_score = self._game.scores[color]["projected"]

                # The new projected score after the theoretical move
                projected_score = self.project_move(spot, color)[color]["projected"]

                # What the opponent gained with the theoretical move
                gain += projected_score - current_score

        gain = gain / (player_count - 1)
        return gain

        Calculates the average gain in projected scoring for each opponent if
        the opponent were to go in the passed spot.

        Args:
            spot: (x, y) spot to evalulate

        Returns:
            (int) Average projected gain for opponents' moving in the spot.
        
Calculates the average gain in projected scoring for each opponent if
the opponent were to go in the passed spot.
Calculates the average gain in projected scoring for each opponent if the opponent were to go in the passed spot .
def _calculate_opponent_gain(self, spot):
        gain = 0
        player_count = self._game.settings["player_count"]
        for color in range(1, player_count + 1):
            if color != self._color:
                current_score = self._game.scores[color]["projected"]
                projected_score = self.project_move(spot, color)[color]["projected"]
                gain += projected_score - current_score
        gain = gain / (player_count - 1)
        return gain
def _calculate_opponent_gain ( self , spot ) : gain = 0 player_count = self . _game . settings [ "player_count" ] for color in range ( 1 , player_count + 1 ) : if color != self . _color : current_score = self . _game . scores [ color ] [ "projected" ] projected_score = self . project_move ( spot , color ) [ color ] [ "projected" ] gain += projected_score - current_score gain = gain / ( player_count - 1 ) return gain
Calculates the average gain in projected scoring for each opponent if
the opponent were to go in the passed spot.
Calculates the average gain in projected scoring for each opponent if the opponent were to go in the passed spot .
"""
        Calculates the average gain in projected scoring for each opponent if
        the opponent were to go in the passed spot.

        Args:
            spot: (x, y) spot to evalulate

        Returns:
            (int) Average projected gain for opponents' moving in the spot.
        """ # Only calculate projection for opponent colors # The current projected score for the color # The new projected score after the theoretical move # What the opponent gained with the theoretical move
(int) Average projected gain for opponents' moving in the spot.
( int ) Average projected gain for opponents ' moving in the spot .
self
spot
(x, y) spot to evalulate
( x y ) spot to evalulate