Merge branch 'main' of https://github.com/hykilpikonna/CSC111
This commit is contained in:
@@ -89,7 +89,7 @@ class GameTree:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def add_subtree(self, subtree: GameTree) -> None:
|
def add_subtree(self, subtree: GameTree) -> None:
|
||||||
"""Add a subtree to this game tree."""
|
"""Add a subtree to this game tree and updates white win probability."""
|
||||||
self._subtrees.append(subtree)
|
self._subtrees.append(subtree)
|
||||||
self._update_white_win_probability()
|
self._update_white_win_probability()
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ def part1_runner(games_file: str, n: int, black_random: bool) -> None:
|
|||||||
"""
|
"""
|
||||||
tree = load_game_tree(games_file)
|
tree = load_game_tree(games_file)
|
||||||
white = RandomTreePlayer(tree)
|
white = RandomTreePlayer(tree)
|
||||||
black = a2_minichess.RandomPlayer() if black_random else white
|
black = a2_minichess.RandomPlayer() if black_random else RandomTreePlayer(tree)
|
||||||
a2_minichess.run_games(n, white, black, show_stats=True)
|
a2_minichess.run_games(n, white, black, show_stats=True)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user