diff --git a/assignments/A2/a2_game_tree.py b/assignments/A2/a2_game_tree.py index 8e77246..15109d7 100644 --- a/assignments/A2/a2_game_tree.py +++ b/assignments/A2/a2_game_tree.py @@ -103,13 +103,9 @@ class GameTree: The indentation level is specified by the parameter. """ - if self.is_white_move: - turn_desc = "White's move" - else: - turn_desc = "Black's move" - move_desc = f'{self.move} -> {turn_desc}\n' - s = ' ' * depth + move_desc - if self._subtrees == []: + move_desc = f'{self.move}-{self.white_win_probability}\n' + s = '| ' * depth + move_desc + if not self._subtrees: return s else: for subtree in self._subtrees: @@ -220,14 +216,6 @@ class GameTree: if __name__ == '__main__': - import python_ta.contracts - python_ta.contracts.check_all_contracts() - - import doctest - doctest.testmod() - - import python_ta - python_ta.check_all(config={ - 'max-line-length': 100, - 'disable': ['E1136'], - }) + g = GameTree() + g.insert_move_sequence(['a1b1', 'a2b1'], 1.0) + print(g) diff --git a/assignments/A2/a2_part1.py b/assignments/A2/a2_part1.py index 6b8f590..6742830 100644 --- a/assignments/A2/a2_part1.py +++ b/assignments/A2/a2_part1.py @@ -181,4 +181,4 @@ if __name__ == '__main__': }) # Sample call to part1_runner (you can change this, just keep it in the main block!) - part1_runner('data/white_wins.csv', 50, True) + part1_runner('data/white_wins.csv', 50, False)