当前位置: 首页>>代码示例>>Python>>正文


Python go.is_eyeish方法代码示例

本文整理汇总了Python中go.is_eyeish方法的典型用法代码示例。如果您正苦于以下问题:Python go.is_eyeish方法的具体用法?Python go.is_eyeish怎么用?Python go.is_eyeish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在go的用法示例。


在下文中一共展示了go.is_eyeish方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_is_eyeish

# 需要导入模块: import go [as 别名]
# 或者: from go import is_eyeish [as 别名]
def test_is_eyeish(self):
        board = test_utils.load_board('''
            .XX...XXX
            X.X...X.X
            XX.....X.
            ........X
            XXXX.....
            OOOX....O
            X.OXX.OO.
            .XO.X.O.O
            XXO.X.OO.
        ''')
        B_eyes = coords_from_kgs_set('A2 A9 B8 J7 H8')
        W_eyes = coords_from_kgs_set('H2 J1 J3')
        not_eyes = coords_from_kgs_set('B3 E5')
        for be in B_eyes:
            self.assertEqual(go.is_eyeish(board, be), BLACK, str(be))
        for we in W_eyes:
            self.assertEqual(go.is_eyeish(board, we), WHITE, str(we))
        for ne in not_eyes:
            self.assertEqual(go.is_eyeish(board, ne), None, str(ne)) 
开发者ID:mlperf,项目名称:training_results_v0.5,代码行数:23,代码来源:test_go.py

示例2: test_is_eyeish

# 需要导入模块: import go [as 别名]
# 或者: from go import is_eyeish [as 别名]
def test_is_eyeish(self):
        board = load_board('''
            .XX...XXX
            X.X...X.X
            XX.....X.
            ........X
            XXXX.....
            OOOX....O
            X.OXX.OO.
            .XO.X.O.O
            XXO.X.OO.
        ''')
        B_eyes = pc_set('A2 A9 B8 J7 H8')
        W_eyes = pc_set('H2 J1 J3')
        not_eyes = pc_set('B3 E5')
        for be in B_eyes:
            self.assertEqual(go.is_eyeish(board, be), BLACK, str(be))
        for we in W_eyes:
            self.assertEqual(go.is_eyeish(board, we), WHITE, str(we))
        for ne in not_eyes:
            self.assertEqual(go.is_eyeish(board, ne), None, str(ne)) 
开发者ID:llSourcell,项目名称:alphago_demo,代码行数:23,代码来源:test_go.py

示例3: test_is_eyeish

# 需要导入模块: import go [as 别名]
# 或者: from go import is_eyeish [as 别名]
def test_is_eyeish(self):
    board = utils_test.load_board('''
      .XX...XXX
      X.X...X.X
      XX.....X.
      ........X
      XXXX.....
      OOOX....O
      X.OXX.OO.
      .XO.X.O.O
      XXO.X.OO.
    ''')
    B_eyes = coords_from_kgs_set('A2 A9 B8 J7 H8')
    W_eyes = coords_from_kgs_set('H2 J1 J3')
    not_eyes = coords_from_kgs_set('B3 E5')
    for be in B_eyes:
      self.assertEqual(go.is_eyeish(
          utils_test.BOARD_SIZE, board, be), BLACK, str(be))
    for we in W_eyes:
      self.assertEqual(go.is_eyeish(
          utils_test.BOARD_SIZE, board, we), WHITE, str(we))
    for ne in not_eyes:
      self.assertEqual(go.is_eyeish(
          utils_test.BOARD_SIZE, board, ne), None, str(ne)) 
开发者ID:itsamitgoel,项目名称:Gun-Detector,代码行数:26,代码来源:go_test.py

示例4: test_is_eyeish

# 需要导入模块: import go [as 别名]
# 或者: from go import is_eyeish [as 别名]
def test_is_eyeish(self):
        board = test_utils.load_board('''
            .XX...XXX
            X.X...X.X
            XX.....X.
            ........X
            XXXX.....
            OOOX....O
            X.OXX.OO.
            .XO.X.O.O
            XXO.X.OO.
        ''')
        B_eyes = coords_from_gtp_set('A2 A9 B8 J7 H8')
        W_eyes = coords_from_gtp_set('H2 J1 J3')
        not_eyes = coords_from_gtp_set('B3 E5')
        for be in B_eyes:
            self.assertEqual(go.is_eyeish(board, be), BLACK, str(be))
        for we in W_eyes:
            self.assertEqual(go.is_eyeish(board, we), WHITE, str(we))
        for ne in not_eyes:
            self.assertEqual(go.is_eyeish(board, ne), None, str(ne)) 
开发者ID:mlperf,项目名称:training,代码行数:23,代码来源:test_go.py

示例5: is_move_reasonable

# 需要导入模块: import go [as 别名]
# 或者: from go import is_eyeish [as 别名]
def is_move_reasonable(position, move):
    # A move is reasonable if it is legal and doesn't fill in your own eyes.
    return position.is_move_legal(move) and go.is_eyeish(position.board, move) != position.to_play 
开发者ID:llSourcell,项目名称:alphago_demo,代码行数:5,代码来源:strategies.py

示例6: is_move_reasonable

# 需要导入模块: import go [as 别名]
# 或者: from go import is_eyeish [as 别名]
def is_move_reasonable(position, move):
    return position.is_move_legal(move) and go.is_eyeish(position.board, move) != position.to_play 
开发者ID:brilee,项目名称:MuGo,代码行数:4,代码来源:strategies.py

示例7: play_valid_move

# 需要导入模块: import go [as 别名]
# 或者: from go import is_eyeish [as 别名]
def play_valid_move(self, position, move_probs):
        for move in sorted_moves(move_probs):
            if go.is_eyeish(position.board, move):
                continue
            try:
                candidate_pos = position.play_move(move, mutate=True)
            except go.IllegalMove:
                continue
            else:
                return candidate_pos
        return position.pass_move(mutate=True) 
开发者ID:brilee,项目名称:MuGo,代码行数:13,代码来源:strategies.py


注:本文中的go.is_eyeish方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。