From 99eba3bc33c62496580d87de9efde69f3966de28 Mon Sep 17 00:00:00 2001 From: Thomas Lindner Date: Thu, 29 Dec 2022 17:39:58 +0100 Subject: [PATCH] introduce BlunderEvaluator --- src/blunderboard/__init__.py | 5 ++++- src/blunderboard/blunderevaluator.py | 6 ++++++ src/blunderboard/movegenerator.py | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/blunderboard/blunderevaluator.py diff --git a/src/blunderboard/__init__.py b/src/blunderboard/__init__.py index 2c681c3..f847e90 100644 --- a/src/blunderboard/__init__.py +++ b/src/blunderboard/__init__.py @@ -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) diff --git a/src/blunderboard/blunderevaluator.py b/src/blunderboard/blunderevaluator.py new file mode 100644 index 0000000..e7a6c31 --- /dev/null +++ b/src/blunderboard/blunderevaluator.py @@ -0,0 +1,6 @@ +class BlunderEvaluator: + def reset(self): + pass + + def move(self, move): + pass diff --git a/src/blunderboard/movegenerator.py b/src/blunderboard/movegenerator.py index 5e17210..3cb50c9 100644 --- a/src/blunderboard/movegenerator.py +++ b/src/blunderboard/movegenerator.py @@ -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))