[+] Experimental changes

This commit is contained in:
Hykilpikonna
2022-02-23 12:25:56 -05:00
parent 1c7a9bb028
commit 4262c86d26
2 changed files with 7 additions and 19 deletions
+6 -18
View File
@@ -103,13 +103,9 @@ class GameTree:
The indentation level is specified by the <depth> 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)
+1 -1
View File
@@ -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)