board.py
def score_group(*group: Player) -> int:
            """Return score to add for a group of cells"""
            # the more connected pieces you have, the closer you are to winning
            # each pair represents the number of your symbol and number of opponent's symbol
            POINTS_BY_COUNT = {
                # player has four in a row
                (self.SEQ_LENGTH, 0): 2 * self.VICTORY_VALUE,
                # player has three in a row
                (self.SEQ_LENGTH - 1, 0): 300,
                # player has two in a row
                (self.SEQ_LENGTH - 2, 0): 50,
                # player has one in a row
                (self.SEQ_LENGTH - 3, 0): 10,
            }
            # get number of max's pieces in the group
            count_max = count_symbol(maximizing_player, *group)
            # get number of min's pieces in the group
            count_min = count_symbol(minimizing_player, *group)
            # compute how much of an advantage each player has in the group
            max_advantage = POINTS_BY_COUNT.get((count_max, count_min), 0)
            min_advantage = POINTS_BY_COUNT.get((count_min, count_max), 0)
            return max_advantage - min_advantage
Return score to add for a group of cells
Return score to add for a group of cells
Return score to add for a group of cells
def score_group(*group: Player) -> int:
            POINTS_BY_COUNT = {
                (self.SEQ_LENGTH, 0): 2 * self.VICTORY_VALUE,
                (self.SEQ_LENGTH - 1, 0): 300,
                (self.SEQ_LENGTH - 2, 0): 50,
                (self.SEQ_LENGTH - 3, 0): 10,
            }
            count_max = count_symbol(maximizing_player, *group)
            count_min = count_symbol(minimizing_player, *group)
            max_advantage = POINTS_BY_COUNT.get((count_max, count_min), 0)
            min_advantage = POINTS_BY_COUNT.get((count_min, count_max), 0)
            return max_advantage - min_advantage
def score_group ( * group : Player ) -> int : POINTS_BY_COUNT = { ( self . SEQ_LENGTH , 0 ) : 2 * self . VICTORY_VALUE , ( self . SEQ_LENGTH - 1 , 0 ) : 300 , ( self . SEQ_LENGTH - 2 , 0 ) : 50 , ( self . SEQ_LENGTH - 3 , 0 ) : 10 , } count_max = count_symbol ( maximizing_player , * group ) count_min = count_symbol ( minimizing_player , * group ) max_advantage = POINTS_BY_COUNT . get ( ( count_max , count_min ) , 0 ) min_advantage = POINTS_BY_COUNT . get ( ( count_min , count_max ) , 0 ) return max_advantage - min_advantage
Return score to add for a group of cells
Return score to add for a group of cells
"""Return score to add for a group of cells""" # the more connected pieces you have, the closer you are to winning
 # each pair represents the number of your symbol and number of opponent's symbol
 # player has four in a row
 # player has three in a row
 # player has two in a row
 # player has one in a row
 # get number of max's pieces in the group
 # get number of min's pieces in the group
 # compute how much of an advantage each player has in the group

group
Player