def update_path(self, board, color, path):
wins = board.score(BLACK) >= board.score(WHITE)<EOL>for node in path:<EOL><INDENT>if color == BLACK:<EOL><INDENT>color = WHITE<EOL><DEDENT>else:<EOL><INDENT>color = BLACK<EOL><DEDENT>if wins == (color == BLACK):<EOL><INDENT>node.wins += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>node.losses += <NUM_LIT:1><EOL><DEDENT>if node.parent:<EOL><INDENT>node.parent.bestchild = node.parent.best_child()<EOL><DEDENT><DEDENT>
update win/loss count along path