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


Python go.place_stones方法代码示例

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


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

示例1: add_stones

# 需要导入模块: import go [as 别名]
# 或者: from go import place_stones [as 别名]
def add_stones(pos, black_stones_added, white_stones_added):
    working_board = np.copy(pos.board)
    go.place_stones(working_board, go.BLACK, black_stones_added)
    go.place_stones(working_board, go.WHITE, white_stones_added)
    new_position = Position(board=working_board, n=pos.n, komi=pos.komi,
                            caps=pos.caps, ko=pos.ko, recent=pos.recent, to_play=pos.to_play)
    return new_position 
开发者ID:mlperf,项目名称:training_results_v0.5,代码行数:9,代码来源:sgf_wrapper.py

示例2: add_stones

# 需要导入模块: import go [as 别名]
# 或者: from go import place_stones [as 别名]
def add_stones(pos, black_stones_added, white_stones_added):
    working_board = np.copy(pos.board)
    go.place_stones(working_board, go.BLACK, black_stones_added)
    go.place_stones(working_board, go.WHITE, white_stones_added)
    new_position = Position(board=working_board, n=pos.n, komi=pos.komi, caps=pos.caps, ko=pos.ko, recent=pos.recent, to_play=pos.to_play)
    return new_position 
开发者ID:llSourcell,项目名称:alphago_demo,代码行数:8,代码来源:sgf_wrapper.py

示例3: add_stones

# 需要导入模块: import go [as 别名]
# 或者: from go import place_stones [as 别名]
def add_stones(board_size, pos, black_stones_added, white_stones_added):
  working_board = np.copy(pos.board)
  go.place_stones(working_board, go.BLACK, black_stones_added)
  go.place_stones(working_board, go.WHITE, white_stones_added)
  new_position = Position(
      board_size, board=working_board, n=pos.n, komi=pos.komi,
      caps=pos.caps, ko=pos.ko, recent=pos.recent, to_play=pos.to_play)
  return new_position 
开发者ID:itsamitgoel,项目名称:Gun-Detector,代码行数:10,代码来源:sgf_wrapper.py

示例4: sgf_prop

# 需要导入模块: import go [as 别名]
# 或者: from go import place_stones [as 别名]
def sgf_prop(value_list):
    if value_list is None:
        return None
    if len(value_list) == 1:
        return value_list[0]
    else:
        return value_list


# def handle_node(pos, node):
#     props = node.properties
#     black_stones_added = [from_sgf(
#         c) for c in props.get('AB', [])]
#     white_stones_added = [from_sgf(
#         c) for c in props.get('AW', [])]
#     if black_stones_added or white_stones_added:
#         return add_stones(pos, black_stones_added, white_stones_added)
#     # If B/W props are not present, then there is no move. But if it is present and equal to the empty string, then the move was a pass.
#     elif 'B' in props:
#         black_move = from_sgf(props.get('B', [''])[0])
#         return pos.play_move(black_move, color=GOPARAMETERS.BLACK)
#     elif 'W' in props:
#         white_move = from_sgf(props.get('W', [''])[0])
#         return pos.play_move(white_move, color=GOPARAMETERS.WHITE)
#     else:
#         return pos


# def add_stones(pos, black_stones_added, white_stones_added):
#     working_board = np.copy(pos.board)
#     go.place_stones(working_board, GOPARAMETERS.BLACK, black_stones_added)
#     go.place_stones(working_board, GOPARAMETERS.WHITE, white_stones_added)
#     new_position = BoardState(board=working_board, n=pos.n, komi=pos.komi,
#                               caps=pos.caps, ko=pos.ko, recent=pos.recent, to_play=pos.to_play)
#     return new_position 
开发者ID:PacktPublishing,项目名称:Python-Reinforcement-Learning-Projects,代码行数:37,代码来源:utils.py


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