introduce BlunderEvaluator
This commit is contained in:
parent
0f064e3338
commit
99eba3bc33
|
@ -1,10 +1,13 @@
|
||||||
|
from blunderboard.blunderevaluator import BlunderEvaluator
|
||||||
from blunderboard.boardreader import BoardReader
|
from blunderboard.boardreader import BoardReader
|
||||||
from blunderboard.movegenerator import MoveGenerator
|
from blunderboard.movegenerator import MoveGenerator
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
reader = BoardReader(MoveGenerator())
|
blunder_evaluator = BlunderEvaluator()
|
||||||
|
move_generator = MoveGenerator(blunder_evaluator)
|
||||||
|
reader = BoardReader(move_generator)
|
||||||
while True:
|
while True:
|
||||||
reader.scan()
|
reader.scan()
|
||||||
sleep(0.1)
|
sleep(0.1)
|
||||||
|
|
6
src/blunderboard/blunderevaluator.py
Normal file
6
src/blunderboard/blunderevaluator.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
class BlunderEvaluator:
|
||||||
|
def reset(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def move(self, move):
|
||||||
|
pass
|
|
@ -1,8 +1,15 @@
|
||||||
|
from blunderboard.blunderevaluator import BlunderEvaluator
|
||||||
|
|
||||||
|
|
||||||
class MoveGenerator:
|
class MoveGenerator:
|
||||||
columns = "abcdefgh"
|
columns = "abcdefgh"
|
||||||
|
|
||||||
|
def __init__(self, blunder_evaluator: BlunderEvaluator):
|
||||||
|
self.blunder_evaluator = blunder_evaluator
|
||||||
|
|
||||||
def reset(self) -> None:
|
def reset(self) -> None:
|
||||||
print("reset")
|
print("reset")
|
||||||
|
self.blunder_evaluator.reset()
|
||||||
|
|
||||||
def put(self, row: int, column: int) -> None:
|
def put(self, row: int, column: int) -> None:
|
||||||
print("put %c%d" % (self.columns[column], row + 1))
|
print("put %c%d" % (self.columns[column], row + 1))
|
||||||
|
|
Loading…
Reference in a new issue