コード例 #1
0
    def search(node):
        for mv in node["history"]:
            leela.add_move(leela.whoseturn(), mv)
        stats, move_list = do_analyze(leela, base_dir, verbosity)
        expand(node, stats, move_list)

        for mv in node["history"]:
            leela.pop_move()
コード例 #2
0
ファイル: sgfanalyze.py プロジェクト: yywhack/leela-analysis
def add_moves_to_leela(C, leela):
    this_move = None
    if 'W' in C.node.keys():
        this_move = C.node['W'].data[0]
        leela.add_move('white', this_move)
    if 'B' in C.node.keys():
        this_move = C.node['B'].data[0]
        leela.add_move('black', this_move)
    # SGF commands to add black or white stones, often used for setting up handicap and such
    if 'AB' in C.node.keys():
        for move in C.node['AB'].data:
            leela.add_move('black', move)
    if 'AW' in C.node.keys():
        for move in C.node['AW'].data:
            leela.add_move('white', move)
    return this_move