Merge Python Branch into Main #1

Merged
hagi merged 45 commits from python into main 2022-12-30 19:15:27 +00:00
3 changed files with 17 additions and 1 deletions
Showing only changes of commit 99eba3bc33 - Show all commits

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))