From 0fd43eb6d9a4bae8d4c29fd614f9cf2a362f7b7c Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 9 Nov 2026 16:17:04 +1300 Subject: feat: Draw by threefold repetition A position coming up for the third time with the same side to move ends the game as a draw, in the TUI and in training self-play. Players now get the game's earlier boards in pick_move, and the search scores the first repetition on its path as a draw, so a side that is ahead avoids one and a side that is behind seeks one. Co-Authored-By: Claude Opus 5.5 --- src/claude-player.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/claude-player.rs') diff --git a/src/claude-player.rs b/src/claude-player.rs index c25c5e1..2b7004c 100644 --- a/src/claude-player.rs +++ b/src/claude-player.rs @@ -92,12 +92,12 @@ mod tests fn pick_move_reports_its_search() { let mut player = ClaudePlayer::new(Duration::from_millis(50)); - let m = player.pick_move(GameBoard::default(), Turn::Tiger).unwrap(); + let m = player.pick_move(GameBoard::default(), Turn::Tiger, &[]).unwrap(); let report = player.last_search.expect("a report"); assert_eq!(report.mv, m); assert!(report.depth >= 1); assert_eq!(report.score, player.minimax(GameBoard::default(), Turn::Tiger, report.depth, - f32::NEG_INFINITY, f32::INFINITY, None).unwrap()); + f32::NEG_INFINITY, f32::INFINITY, None, &mut Vec::new()).unwrap()); player.reset(); assert_eq!(player.last_search, None); -- cgit v1.3.1