crocrodile.engine
- Engine¶
MyEngine Engine base.
Base engine
-
class
crocrodile.engine.
EngineBase
(name, author, board=Board('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1'))[source]¶ Engine base.
-
get_book_move
()[source]¶ Get move from opening book.
- Paramètres
board (chess.Board) – Board to get move.
- Renvoie
A random move from the opening book?
- Type renvoyé
Optional[chess.Move]
-
get_syzygy
(board: chess.Board) → tuple[source]¶ Get a move from Syzygy tablebases.
- Paramètres
board (chess.Board) – Board to get best move and evaluation.
- Renvoie
The evaluation from Syzygy tablebases and the best move.
- Type renvoyé
tuple[int, chess.Move]
-
minimax_nn
(board: chess.Board, depth, maximimize_white, limit_time)[source]¶ Minimax algorithm from Wikipedia with NN.
-
minimax_std
(board, depth, maximimize_white, limit_time)[source]¶ Minimax algorithm from Wikipedia with NN.
-
crocrodile.engine.evaluate
- Evaluation¶
Crocrodile Evaluation.
Evaluation: Evaluate position.
-
class
crocrodile.engine.evaluate.
Evaluator
[source]¶ Base class for evaluation (v2).
-
static
eval_castling
(position: chess.Board, move: chess.Move) → int[source]¶ Evaluate castling in the given position.
- Paramètres
position (chess.Board) – Position to evaluate.
move (chess.Move) – Move to evaluate.
- Renvoie
White’s castling advantage as centipawns.
- Type renvoyé
int
-
static
eval_center
(position: chess.Board) → int[source]¶ Evaluate center occupation.
- Paramètres
position (chess.Board) – Position to evaluate.
- Renvoie
White’s center advantage as centipawns.
- Type renvoyé
int
-
static
eval_developpement
(position: chess.Board)[source]¶ Evaluate pieces developpement and activity in the given position.
- Paramètres
position (chess.Board) – Position to evaluate.
- Renvoie
White’s material advantage as centipawns.
- Type renvoyé
int
-
static
eval_king_protection
(position: chess.Board) → int[source]¶ Evaluate king protection score of White in the given position.
- Paramètres
position (chess.Board) – Position to evaluate.
- Renvoie
White’s material advantage as centipawns.
- Type renvoyé
int
-
static
eval_material
(position: chess.Board) → int[source]¶ Evaluate material advantage of White in the given position.
- Paramètres
position (chess.Board) – Position to evaluate.
- Renvoie
White’s material advantage as centipawns.
- Type renvoyé
int
-
evaluate
(position: chess.Board, move: chess.Move = Move.from_uci('0000')) → int[source]¶ Evaluate position and return white’s advantage in centipans.
- Paramètres
position (chess.Board) – Position to evaluate.
move (chess.Move) – Move who will be played.
- Renvoie
White’s advantage as centipawns.
- Type renvoyé
int
-
static
-
crocrodile.engine.evaluate.
check_passed_pawns
(board: chess.Board, color: bool) → int[source]¶ Evaluation: Check paseed pawns.
- Paramètres
board (chess.Board) – Board.
color (bool) – Color to add bonus (True is white).
- Renvoie
Bonus points.
- Type renvoyé
int