Rafs-an09002's picture
Create engine/endgame.py
db00797 verified
raw
history blame contribute delete
558 Bytes
"""
Endgame Detection for Nexus-Nano
Minimal overhead detection
"""
import chess
class EndgameDetector:
"""Basic endgame detection"""
def is_known_draw(self, board: chess.Board) -> bool:
"""Quick draw detection"""
return (
board.is_insufficient_material() or
board.halfmove_clock >= 100
)
def adjust_evaluation(self, board: chess.Board, eval_score: float) -> float:
"""Minimal adjustment"""
if self.is_known_draw(board):
return 0.0
return eval_score