From e2e9371a0593083376f7333eabfab2fe4f3bcfc4 Mon Sep 17 00:00:00 2001 From: Tearth Date: Sun, 31 Jul 2022 13:34:46 +0200 Subject: [PATCH] Documentation fixes --- src/engine/search.rs | 7 ++++--- src/engine/see.rs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/engine/search.rs b/src/engine/search.rs index 6694def3..50765d94 100644 --- a/src/engine/search.rs +++ b/src/engine/search.rs @@ -67,6 +67,7 @@ enum MoveGeneratorStage { AllGenerated, } +/// Wrapper for the entry point of the regular search, look at `run_internal` for more information. pub fn run(context: &mut SearchContext, depth: i8) { let king_checked = context.board.is_king_checked(context.board.active_color); run_internal::(context, depth, 0, MIN_ALPHA, MIN_BETA, true, king_checked); @@ -688,7 +689,7 @@ fn static_null_move_pruning_get_margin(depth: i8) -> i16 { /// /// Conditions: /// - only non-PV nodes -/// - depth >= [NULL_MOVE_MIN_DEPTH] +/// - depth >= [NULL_MOVE_PRUNING_MIN_DEPTH] /// - game phase is not indicating endgame /// - beta score is not a mate score /// - friendly king is not checked @@ -707,8 +708,8 @@ fn null_move_pruning_can_be_applied( && allow_null_move } -/// Gets the null move pruning depth reduction, called R, based on `depth`. It returns [NULL_MOVE_SMALL_R] if `depth` is less or equal -/// to [NULL_MOVE_R_CHANGE_DEPTH], otherwise [NULL_MOVE_BIG_R]. +/// Gets the null move pruning depth reduction, called R, based on `depth`. It returns [NULL_MOVE_PRUNING_SMALL_R] if `depth` is less or equal +/// to [NULL_MOVE_PRUNING_R_CHANGE_DEPTH], otherwise [NULL_MOVE_PRUNING_BIG_R]. fn null_move_pruning_get_r(depth: i8) -> i8 { if depth <= NULL_MOVE_PRUNING_R_CHANGE_DEPTH { NULL_MOVE_PRUNING_SMALL_R diff --git a/src/engine/see.rs b/src/engine/see.rs index 948ed586..5a637272 100644 --- a/src/engine/see.rs +++ b/src/engine/see.rs @@ -49,7 +49,7 @@ impl SEEContainer { self.evaluate_internal(attacking_piece_index, target_piece_index, attackers, defenders, evaluation_parameters) } - /// Recursive function called by [evaluate] to help evaluate a static exchange evaluation result. + /// Recursive function called by `evaluate` to help evaluate a static exchange evaluation result. fn evaluate_internal(&self, attacking_piece: u8, target_piece: u8, attackers: u8, defenders: u8, evaluation_parameters: &EvaluationParameters) -> i16 { if attackers == 0 { return 0; @@ -84,7 +84,7 @@ impl SEEContainer { } } - /// Gets a piece value based on `piece_index` saved in SEE format (look [get_see_piece_index]). + /// Gets a piece value based on `piece_index` saved in SEE format (look `get_see_piece_index`). fn get_piece_value(&self, piece_index: u8, evaluation_parameters: &EvaluationParameters) -> i16 { match piece_index { 0 => evaluation_parameters.piece_value[PAWN as usize] as i16, // Pawn