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.
- minimax_nn(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.
- Parameters
position (chess.Board) – Position to evaluate.
move (chess.Move) – Move to evaluate.
- Returns
White’s castling advantage as centipawns.
- Return type
int
- static eval_developpement(position: chess.Board)[source]
Evaluate pieces developpement and activity in the given position.
- Parameters
position (chess.Board) – Position to evaluate.
- Returns
White’s material advantage as centipawns.
- Return type
int
- static eval_king_protection(position: chess.Board) int[source]
Evaluate king protection score of White in the given position.
- Parameters
position (chess.Board) – Position to evaluate.
- Returns
White’s material advantage as centipawns.
- Return type
int
- static eval_material(position: chess.Board) int[source]
Evaluate material advantage of White in the given position.
- Parameters
position (chess.Board) – Position to evaluate.
- Returns
White’s material advantage as centipawns.
- Return type
int
- evaluate(position: chess.Board, move: chess.Move = Move.from_uci('0000')) int[source]
Evaluate position and return white’s advantage in centipans.
- Parameters
position (chess.Board) – Position to evaluate.
move (chess.Move) – Move who will be played.
- Returns
White’s advantage as centipawns.
- Return type
int
- crocrodile.engine.evaluate.check_passed_pawns(board: chess.Board, color: bool) int[source]
Evaluation: Check paseed pawns.
- Parameters
board (chess.Board) – Board.
color (bool) – Color to add bonus (True is white).
- Returns
Bonus points.
- Return type
int