當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。