replace broken AI search with negamax and alpha-beta
- fix the no-op best-score update that ignored all but the first reply - alternate sides correctly with negamax and add alpha-beta pruning - score terminal wins and losses above material evaluations - treat depth zero as one ply instead of underflowing - guard relative_score against an empty board - add hanging-piece, recapture, terminal, and depth regression tests
This commit is contained in:
@@ -29,6 +29,14 @@ The rules implemented by the engine are an 8x8 draughts variant:
|
||||
- A man is promoted to a king when it reaches the opponent's back row.
|
||||
- Draw rules (repetition, move limits) are not implemented yet.
|
||||
|
||||
## AI
|
||||
|
||||
The engine exposes a fixed-depth negamax search with alpha-beta pruning through
|
||||
`DraughtsGame::get_best_move(max_depth)`. A depth of zero is treated as one ply.
|
||||
Wins and losses dominate material scoring, and faster wins are preferred. The
|
||||
search has no time or node budget and no draw/repetition detection, so choose a
|
||||
modest depth for positions with many pieces.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Rust 1.87 or newer. The workspace uses edition 2024.
|
||||
|
||||
Reference in New Issue
Block a user