Compare commits
1 Commits
main
...
experiment
| Author | SHA1 | Date | |
|---|---|---|---|
| 4262c86d26 |
@@ -103,13 +103,9 @@ class GameTree:
|
|||||||
|
|
||||||
The indentation level is specified by the <depth> parameter.
|
The indentation level is specified by the <depth> parameter.
|
||||||
"""
|
"""
|
||||||
if self.is_white_move:
|
move_desc = f'{self.move}-{self.white_win_probability}\n'
|
||||||
turn_desc = "White's move"
|
s = '| ' * depth + move_desc
|
||||||
else:
|
if not self._subtrees:
|
||||||
turn_desc = "Black's move"
|
|
||||||
move_desc = f'{self.move} -> {turn_desc}\n'
|
|
||||||
s = ' ' * depth + move_desc
|
|
||||||
if self._subtrees == []:
|
|
||||||
return s
|
return s
|
||||||
else:
|
else:
|
||||||
for subtree in self._subtrees:
|
for subtree in self._subtrees:
|
||||||
@@ -220,14 +216,6 @@ class GameTree:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import python_ta.contracts
|
g = GameTree()
|
||||||
python_ta.contracts.check_all_contracts()
|
g.insert_move_sequence(['a1b1', 'a2b1'], 1.0)
|
||||||
|
print(g)
|
||||||
import doctest
|
|
||||||
doctest.testmod()
|
|
||||||
|
|
||||||
import python_ta
|
|
||||||
python_ta.check_all(config={
|
|
||||||
'max-line-length': 100,
|
|
||||||
'disable': ['E1136'],
|
|
||||||
})
|
|
||||||
|
|||||||
@@ -181,4 +181,4 @@ if __name__ == '__main__':
|
|||||||
})
|
})
|
||||||
|
|
||||||
# Sample call to part1_runner (you can change this, just keep it in the main block!)
|
# 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)
|
||||||
|
|||||||
Reference in New Issue
Block a user