Skip to content

Commit e116acf

Browse files
committed
refactor: replace print statements with logging in AlphaBeta class and clean up imports in heuristics
1 parent b80ff20 commit e116acf

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@ To build cython files:
1818
cd lab02
1919
python setup.py build_ext --inplace
2020
```
21+
22+
#### Windows
23+
24+
I strongly recommend to make sure Python version has development options enabled
25+
(if not, best to reinstall with them enabled)
26+
27+
VS XX C++ Desktop Development must also be installed

lab02/agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from abc import ABC, abstractmethod
22
from dataclasses import dataclass
3+
import logging
34
import time
45

56
from clobber.board import Board
@@ -200,7 +201,7 @@ def generate_move(self, board: Board) -> move:
200201
best_score = score
201202
best_move = (
202203
position_from, position_to)
203-
print(f"white heuristic: {best_score}")
204+
logging.debug(f"white heuristic: {best_score}")
204205
return best_move
205206

206207
best_score = float("inf")
@@ -217,7 +218,7 @@ def generate_move(self, board: Board) -> move:
217218
best_move = (
218219
position_from, position_to)
219220

220-
print(f"black heuristic: {best_score}")
221+
logging.debug(f"black heuristic: {best_score}")
221222
return best_move
222223

223224

lab02/heuristics.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from _collections_abc import dict_items
21
import random
32
from abc import ABC, abstractmethod
43

0 commit comments

Comments
 (0)