Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tearth committed Jul 31, 2022
1 parent 15765fd commit e2e9371
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/engine/search.rs
Expand Up @@ -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<const DIAG: bool>(context: &mut SearchContext, depth: i8) {
let king_checked = context.board.is_king_checked(context.board.active_color);
run_internal::<true, true, DIAG>(context, depth, 0, MIN_ALPHA, MIN_BETA, true, king_checked);
Expand Down Expand Up @@ -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
Expand All @@ -707,8 +708,8 @@ fn null_move_pruning_can_be_applied<const PV: bool>(
&& 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
Expand Down
4 changes: 2 additions & 2 deletions src/engine/see.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e2e9371

Please sign in to comment.