From c3e3ad42f7c819333c71ae40b98261eb5622f834 Mon Sep 17 00:00:00 2001 From: Lukas Wieser Date: Mon, 29 Jan 2024 23:49:03 +0100 Subject: [PATCH] Remove unused file of lichess-bot --- chesspp/lichess-engine.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 chesspp/lichess-engine.py diff --git a/chesspp/lichess-engine.py b/chesspp/lichess-engine.py deleted file mode 100644 index e2d3b93..0000000 --- a/chesspp/lichess-engine.py +++ /dev/null @@ -1,21 +0,0 @@ -from lichess_bot.lib.engine_wrapper import MinimalEngine, MOVE -import chess.engine - -from chesspp import engine - - -class ProbStockfish(MinimalEngine): - def search(self, board: chess.Board, time_limit: chess.engine.Limit, ponder: bool, draw_offered: bool, - root_moves: MOVE) -> chess.engine.PlayResult: - moves = {} - untried_moves = list(board.legal_moves) - for move in untried_moves: - mean, std = engine.simulate_game(board, move, 10) - moves[move] = (mean, std) - - return self.get_best_move(moves) - - def get_best_move(self, moves: dict) -> chess.engine.PlayResult: - best_avg = max(moves.items(), key=lambda m: m[1][0]) - next_move = best_avg[0] - return chess.engine.PlayResult(next_move, None)