|
@@ -14,7 +14,7 @@ class IllegalMove(Exception):
|
|
|
|
|
|
|
|
|
def outcome_to_str(outcome):
|
|
|
- return f"{outcome.result()} {outcome.termination.name}"
|
|
|
+ return f"{outcome.result()}: {outcome.termination.name}"
|
|
|
|
|
|
|
|
|
class ChessSession:
|
|
@@ -27,7 +27,9 @@ class ChessSession:
|
|
|
|
|
|
def check_game_over(self):
|
|
|
if self.board.is_game_over():
|
|
|
- raise GameOver(f"{outcome_to_str(self.board.outcome())} {len(self.board.move_stack)}")
|
|
|
+ raise GameOver(f"{outcome_to_str(self.board.outcome())} [{len(self.board.move_stack)}]")
|
|
|
+ elif not self.board.is_valid():
|
|
|
+ raise GameOver(f"Некорректное состояние доски.")
|
|
|
|
|
|
async def move(self, move=None):
|
|
|
if move is not None:
|