introduce BlunderEvaluator

This commit is contained in:
Thomas Lindner 2022-12-29 17:39:58 +01:00
parent 0f064e3338
commit 99eba3bc33
3 changed files with 17 additions and 1 deletions

View file

@ -1,10 +1,13 @@
from blunderboard.blunderevaluator import BlunderEvaluator
from blunderboard.boardreader import BoardReader
from blunderboard.movegenerator import MoveGenerator
from time import sleep
def main():
reader = BoardReader(MoveGenerator())
blunder_evaluator = BlunderEvaluator()
move_generator = MoveGenerator(blunder_evaluator)
reader = BoardReader(move_generator)
while True:
reader.scan()
sleep(0.1)

View file

@ -0,0 +1,6 @@
class BlunderEvaluator:
def reset(self):
pass
def move(self, move):
pass

View file

@ -1,8 +1,15 @@
from blunderboard.blunderevaluator import BlunderEvaluator
class MoveGenerator:
columns = "abcdefgh"
def __init__(self, blunder_evaluator: BlunderEvaluator):
self.blunder_evaluator = blunder_evaluator
def reset(self) -> None:
print("reset")
self.blunder_evaluator.reset()
def put(self, row: int, column: int) -> None:
print("put %c%d" % (self.columns[column], row + 1))