本文整理汇总了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
示例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
示例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
示例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