File size: 558 Bytes
db00797
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
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