diff --git a/src/endgame.cpp b/src/endgame.cpp index 4eb992a78..ccf76d81a 100644 --- a/src/endgame.cpp +++ b/src/endgame.cpp @@ -183,7 +183,7 @@ Value Endgame::operator()(const Position& pos) const { Color us = strongSide == pos.side_to_move() ? WHITE : BLACK; // Non-standard promotion, evaluation unclear - /// yjf2002ghty: Since KPK means King-Pawn vs. King Endgame, I assume the piece type is PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) + /// Since KPK means King-Pawn vs. King Endgame, the piece type is assumed to be PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) if ( pos.promotion_zone(us, PAWN) != rank_bb(relative_rank(us, RANK_8, pos.max_rank())) || RANK_MAX != RANK_8 || !(pos.promotion_piece_types(us) & QUEEN)) @@ -938,7 +938,7 @@ ScaleFactor Endgame::operator()(const Position& pos) const { // Probe the KPK bitbase with the weakest side's pawn removed. If it's a draw, // it's probably at least a draw even with the pawn. - /// yjf2002ghty: Since KPKP means King-Pawn vs. King-Pawn Endgame, I assume the piece type is PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) + /// Since KPKP means King-Pawn vs. King-Pawn Endgame, the piece type is assumed to PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) if ( pos.promotion_zone(us, PAWN) != rank_bb(relative_rank(us, RANK_8, pos.max_rank())) || RANK_MAX != RANK_8 || !(pos.promotion_piece_types(us) & QUEEN)) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 36edfb6b2..338fb7073 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -1135,7 +1135,7 @@ namespace { bool pawnsOnly = !(pos.pieces(Us) ^ pos.pieces(Us, PAWN)); // Early exit if, for example, both queens or 6 minor pieces have been exchanged - /// yjf2002ghty: By default double step is used for pawns in enhancing opening evaluation, so I assume the piece type is PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) + /// By default double step is used for pawns in enhancing opening evaluation, so the piece type is assumed to be PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) if (pos.non_pawn_material() < SpaceThreshold && !pawnsOnly && pos.double_step_region(Us, PAWN)) return SCORE_ZERO; diff --git a/src/movegen.cpp b/src/movegen.cpp index 7b8988fd2..5aa88ed33 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -142,12 +142,12 @@ namespace { constexpr Direction UpRight = (Us == WHITE ? NORTH_EAST : SOUTH_WEST); constexpr Direction UpLeft = (Us == WHITE ? NORTH_WEST : SOUTH_EAST); - /// yjf2002ghty: Since it's generate_pawn_moves, I assume the piece type is PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) + /// Since it's generate_pawn_moves, the piece type is assumed to be PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) const Bitboard promotionZone = pos.promotion_zone(Us, PAWN); const Bitboard standardPromotionZone = pos.sittuyin_promotion() ? Bitboard(0) : promotionZone; - /// yjf2002ghty: Since it's generate_pawn_moves, I assume the piece type is PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) + /// Since it's generate_pawn_moves, the piece type is assumed to be PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) const Bitboard doubleStepRegion = pos.double_step_region(Us, PAWN); - /// yjf2002ghty: Since it's generate_pawn_moves, I assume the piece type is PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) + /// Since it's generate_pawn_moves, the piece type is assumed to be PAWN. It can cause problems if the pawn is something else (e.g. Custom pawn piece) const Bitboard tripleStepRegion = pos.triple_step_region(Us, PAWN); const Bitboard pawns = pos.pieces(Us, PAWN); diff --git a/src/movegen.h b/src/movegen.h index ffdd9bfd6..a9b38d71b 100644 --- a/src/movegen.h +++ b/src/movegen.h @@ -28,8 +28,6 @@ namespace Stockfish { class Position; enum GenType { - /// yjf2002ghty: I think it's better to add some explanations here so that new developers can understand what these means, as some of the terms connot be found in chessprogramming wiki. I'm not sure if my explanations are correct. If there are anything wrong, please point it out. - //Moves that a piece is removed from the board as part of the completion of the move CAPTURES, //Moves which do not alter material, thus no captures nor promotions diff --git a/src/position.h b/src/position.h index e0335e165..aaa603583 100644 --- a/src/position.h +++ b/src/position.h @@ -479,7 +479,6 @@ inline Bitboard Position::promotion_zone(Piece p) const { inline Square Position::promotion_square(Color c, Square s) const { assert(var != nullptr); - /// yjf2002ghty: I'm not clear what Square s means, whether it refers to a square of a piece or it can refer to any square. I assume it means a square of a piece which can excute piece_on(s) Piece p = piece_on(s); Bitboard b = ((p == NO_PIECE) ? Bitboard(0) : promotion_zone(p)) & forward_file_bb(c, s) & board_bb(); return !b ? SQ_NONE : c == WHITE ? lsb(b) : msb(b);