self.has_won(board, self.player) has_two_in_line = self.has_two_in_line(board, self.player) opp_win = self.has_won(board, opp) opp_has_two_in_line = self.has_two_in_line(board, opp) score = 0 if win: score += 100 if has_two_in_line: score += 10 if opp_win: score -= 100 if opp_has_two_in_line: score -= 10 return score