No functional change.
};
/// Determine at compile time the best popcount<> specialization according to
-/// whether the platform is 32 or 64 bits, to the maximum number of non-zero
+/// whether the platform is 32 or 64 bit, the maximum number of non-zero
/// bits to count and if the hardware popcnt instruction is available.
const BitCountType Full = HasPopCnt ? CNT_HW_POPCNT : Is64Bit ? CNT_64 : CNT_32;
const BitCountType Max15 = HasPopCnt ? CNT_HW_POPCNT : Is64Bit ? CNT_64_MAX15 : CNT_32_MAX15;
namespace {
// A Polyglot book is a series of "entries" of 16 bytes. All integers are
- // stored in big-endian format, with highest byte first (regardless of size).
- // The entries are ordered according to the key in ascending order.
+ // stored in big-endian format, with the highest byte first (regardless of
+ // size). The entries are ordered according to the key in ascending order.
struct Entry {
uint64_t key;
uint16_t move;
best = max(best, e.count);
sum += e.count;
- // Choose book move according to its score. If a move has a very
- // high score it has higher probability to be choosen than a move
- // with lower score. Note that first entry is always chosen.
+ // Choose book move according to its score. If a move has a very high
+ // score it has a higher probability of being choosen than a move with
+ // a lower score. Note that first entry is always chosen.
if ( (!pickBest && sum && rkiss.rand<unsigned>() % sum < e.count)
|| (pickBest && e.count == best))
move = Move(e.move);
return sq;
}
- // Get the material key of a Position out of the given endgame key code
- // like "KBPKN". The trick here is to first forge an ad-hoc fen string
- // and then let a Position object to do the work for us. Note that the
- // fen string could correspond to an illegal position.
+ // Get the material key of Position out of the given endgame key code
+ // like "KBPKN". The trick here is to first forge an ad-hoc FEN string
+ // and then let a Position object do the work for us. Note that the
+ // FEN string could correspond to an illegal position.
Key key(const string& code, Color c) {
assert(code.length() > 0 && code.length() < 8);
Square loserKSq = pos.king_square(weakSide);
Square bishopSq = pos.list<BISHOP>(strongSide)[0];
- // kbnk_mate_table() tries to drive toward corners A1 or H8, if we have a
- // bishop that cannot reach the above squares we flip the kings in order
+ // kbnk_mate_table() tries to drive toward corners A1 or H8. If we have a
+ // bishop that cannot reach the above squares, we flip the kings in order
// to drive the enemy toward corners A8 or H1.
if (opposite_colors(bishopSq, SQ_A1))
{
}
-/// KR vs KN. The attacking side has slightly better winning chances than
+/// KR vs KN. The attacking side has slightly better winning chances than
/// in KR vs KB, particularly if the king and the knight are far apart.
template<>
Value Endgame<KRKN>::operator()(const Position& pos) const {
/// KQ vs KR. This is almost identical to KX vs K: We give the attacking
/// king a bonus for having the kings close together, and for forcing the
-/// defending king towards the edge. If we also take care to avoid null move
-/// for the defending side in the search, this is usually sufficient to be
-/// able to win KQ vs KR.
+/// defending king towards the edge. If we also take care to avoid null move for
+/// the defending side in the search, this is usually sufficient to win KQ vs KR.
template<>
Value Endgame<KQKR>::operator()(const Position& pos) const {
}
-/// KBB vs KN. This is almost always a win. We try to push enemy king to a corner
+/// KBB vs KN. This is almost always a win. We try to push the enemy king to a corner
/// and away from his knight. For a reference of this difficult endgame see:
/// en.wikipedia.org/wiki/Chess_endgame#Effect_of_tablebases_on_endgame_theory
template<> Value Endgame<KmmKm>::operator()(const Position&) const { return VALUE_DRAW; }
-/// K, bishop and one or more pawns vs K. It checks for draws with rook pawns and
+/// KB and one or more pawns vs K. It checks for draws with rook pawns and
/// a bishop of the wrong color. If such a draw is detected, SCALE_FACTOR_DRAW
/// is returned. If not, the return value is SCALE_FACTOR_NONE, i.e. no scaling
/// will be used.
Square weakKingSq = pos.king_square(weakSide);
Square bishopSq = pos.list<BISHOP>(strongSide)[0];
- // There's potential for a draw if our pawn is blocked on the 7th rank
+ // There's potential for a draw if our pawn is blocked on the 7th rank,
// the bishop cannot attack it or they only have one pawn left
if ( relative_rank(strongSide, weakPawnSq) == RANK_7
&& (pos.pieces(strongSide, PAWN) & (weakPawnSq + pawn_push(weakSide)))
}
-/// K and queen vs K, rook and one or more pawns. It tests for fortress draws with
-/// a rook on the third rank defended by a pawn.
+/// KQ vs KR and one or more pawns. It tests for fortress draws with a rook on
+/// the third rank defended by a pawn.
template<>
ScaleFactor Endgame<KQKRPs>::operator()(const Position& pos) const {
}
-/// K, rook and one pawn vs K and a rook. This function knows a handful of the
-/// most important classes of drawn positions, but is far from perfect. It would
-/// probably be a good idea to add more knowledge in the future.
+/// KRP vs KR. This function knows a handful of the most important classes of
+/// drawn positions, but is far from perfect. It would probably be a good idea
+/// to add more knowledge in the future.
///
/// It would also be nice to rewrite the actual code for this function,
/// which is mostly copied from Glaurung 1.x, and isn't very pretty.
- 8 * square_distance(wpsq, queeningSq)
- 2 * square_distance(wksq, queeningSq));
- // If the pawn is not far advanced, and the defending king is somewhere in
+ // If the pawn is not far advanced and the defending king is somewhere in
// the pawn's path, it's probably a draw.
if (r <= RANK_4 && bksq > wpsq)
{
return SCALE_FACTOR_NONE;
}
-/// K, rook and two pawns vs K, rook and one pawn. There is only a single
-/// pattern: If the stronger side has no passed pawns and the defending king
-/// is actively placed, the position is drawish.
+/// KRPP vs KRP. There is just a single rule: if the stronger side has no passed
+/// pawns and the defending king is actively placed, the position is drawish.
template<>
ScaleFactor Endgame<KRPPKRP>::operator()(const Position& pos) const {
Bitboard pawns = pos.pieces(strongSide, PAWN);
Square psq = pos.list<PAWN>(strongSide)[0];
- // If all pawns are ahead of the king, all pawns are on a single
- // rook file and the king is within one file of the pawns then draw.
+ // If all pawns are ahead of the king, on a single rook file and
+ // the king is within one file of the pawns, it's a draw.
if ( !(pawns & ~in_front_bb(weakSide, rank_of(ksq)))
&& !((pawns & ~FileABB) && (pawns & ~FileHBB))
&& file_distance(ksq, psq) <= 1)
}
-/// K, bishop and a pawn vs K and a bishop. There are two rules: If the defending
-/// king is somewhere along the path of the pawn, and the square of the king is
-/// not of the same color as the stronger side's bishop, it's a draw. If the two
-/// bishops have opposite color, it's almost always a draw.
+/// KBP vs KB. There are two rules: if the defending king is somewhere along the
+/// path of the pawn, and the square of the king is not of the same color as the
+/// stronger side's bishop, it's a draw. If the two bishops have opposite color,
+/// it's almost always a draw.
template<>
ScaleFactor Endgame<KBPKB>::operator()(const Position& pos) const {
}
-/// K, bishop and two pawns vs K and bishop. It detects a few basic draws with
-/// opposite-colored bishops.
+/// KBPP vs KB. It detects a few basic draws with opposite-colored bishops
template<>
ScaleFactor Endgame<KBPPKB>::operator()(const Position& pos) const {
}
-/// K, bisop and a pawn vs K and knight. There is a single rule: If the defending
-/// king is somewhere along the path of the pawn, and the square of the king is
-/// not of the same color as the stronger side's bishop, it's a draw.
+/// KBP vs KN. There is a single rule: If the defending king is somewhere along
+/// the path of the pawn, and the square of the king is not of the same color as
+/// the stronger side's bishop, it's a draw.
template<>
ScaleFactor Endgame<KBPKN>::operator()(const Position& pos) const {
}
-/// K, knight and a pawn vs K. There is a single rule: If the pawn is a rook pawn
-/// on the 7th rank and the defending king prevents the pawn from advancing, the
-/// position is drawn.
+/// KNP vs K. There is a single rule: if the pawn is a rook pawn on the 7th rank
+/// and the defending king prevents the pawn from advancing the position is drawn.
template<>
ScaleFactor Endgame<KNPK>::operator()(const Position& pos) const {
}
-/// K, knight and a pawn vs K and bishop. If knight can block bishop from taking
-/// pawn, it's a win. Otherwise, drawn.
+/// KNP vs KB. If knight can block bishop from taking pawn, it's a win.
+/// Otherwise the position is drawn.
template<>
ScaleFactor Endgame<KNPKB>::operator()(const Position& pos) const {
}
-/// K and a pawn vs K and a pawn. This is done by removing the weakest side's
-/// pawn and probing the KP vs K bitbase: If the weakest side has a draw without
-/// the pawn, she probably has at least a draw with the pawn as well. The exception
-/// is when the stronger side's pawn is far advanced and not on a rook file; in
-/// this case it is often possible to win (e.g. 8/4k3/3p4/3P4/6K1/8/8/8 w - - 0 1).
+/// KP vs KP. This is done by removing the weakest side's pawn and probing the
+/// KP vs K bitbase: If the weakest side has a draw without the pawn, it probably
+/// has at least a draw with the pawn as well. The exception is when the stronger
+/// side's pawn is far advanced and not on a rook file; in this case it is often
+/// possible to win (e.g. 8/4k3/3p4/3P4/6K1/8/8/8 w - - 0 1).
template<>
ScaleFactor Endgame<KPKP>::operator()(const Position& pos) const {
// Scaling functions
SCALE_FUNS,
- KBPsK, // KB+pawns vs K
- KQKRPs, // KQ vs KR+pawns
+ KBPsK, // KB and pawns vs K
+ KQKRPs, // KQ vs KR and pawns
KRPKR, // KRP vs KR
KRPKB, // KRP vs KB
KRPPKRP, // KRPP vs KRP
- KPsK, // King and pawns vs king
+ KPsK, // K and pawns vs K
KBPKB, // KBP vs KB
KBPPKB, // KBPP vs KB
KBPKN, // KBP vs KN
// happen in Chess960 games.
const Score TrappedBishopA1H1 = make_score(50, 50);
- // The SpaceMask[Color] contains the area of the board which is considered
- // by the space evaluation. In the middle game, each side is given a bonus
+ // SpaceMask[Color] contains the area of the board which is considered
+ // by the space evaluation. In the middlegame, each side is given a bonus
// based on how many squares inside this area are safe and available for
// friendly minor pieces.
const Bitboard SpaceMask[] = {
};
// King danger constants and variables. The king danger scores are taken
- // from the KingDanger[]. Various little "meta-bonuses" measuring
- // the strength of the enemy attack are added up into an integer, which
- // is used as an index to KingDanger[].
+ // from KingDanger[]. Various little "meta-bonuses" measuring the strength
+ // of the enemy attack are added up into an integer, which is used as an
+ // index to KingDanger[].
//
// KingAttackWeights[PieceType] contains king attack weights by piece type
const int KingAttackWeights[] = { 0, 0, 2, 2, 3, 5 };
namespace Eval {
/// evaluate() is the main evaluation function. It always computes two
- /// values, an endgame score and a middle game score, and interpolates
+ /// values, an endgame score and a middlegame score, and interpolates
/// between them based on the remaining material.
Value evaluate(const Position& pos) {
score += evaluate_unstoppable_pawns(pos, WHITE, ei)
- evaluate_unstoppable_pawns(pos, BLACK, ei);
- // Evaluate space for both sides, only in middle-game.
+ // Evaluate space for both sides, only in middlegame
if (ei.mi->space_weight())
{
int s = evaluate_space<WHITE>(pos, ei) - evaluate_space<BLACK>(pos, ei);
score += apply_weight(s * ei.mi->space_weight(), Weights[Space]);
}
- // Scale winning side if position is more drawish that what it appears
+ // Scale winning side if position is more drawish than it appears
ScaleFactor sf = eg_value(score) > VALUE_DRAW ? ei.mi->scale_factor(pos, WHITE)
: ei.mi->scale_factor(pos, BLACK);
&& sf == SCALE_FACTOR_NORMAL)
{
// Ignoring any pawns, do both sides only have a single bishop and no
- // other pieces ?
+ // other pieces?
if ( pos.non_pawn_material(WHITE) == BishopValueMg
&& pos.non_pawn_material(BLACK) == BishopValueMg)
{
Value bonus = Outpost[Piece == BISHOP][relative_square(Us, s)];
// Increase bonus if supported by pawn, especially if the opponent has
- // no minor piece which can exchange the outpost piece.
+ // no minor piece which can trade with the outpost piece.
if (bonus && (ei.attackedBy[Us][PAWN] & s))
{
if ( !pos.pieces(Them, KNIGHT)
if (Trace)
Tracing::scores[Us][PASSED] = apply_weight(score, Weights[PassedPawns]);
- // Add the scores to the middle game and endgame eval
+ // Add the scores to the middlegame and endgame eval
return apply_weight(score, Weights[PassedPawns]);
}
}
- // interpolate() interpolates between a middle game and an endgame score,
+ // interpolate() interpolates between a middlegame and an endgame score,
// based on game phase. It also scales the return value by a ScaleFactor array.
Value interpolate(const Score& v, Phase ph, ScaleFactor sf) {
/// Material::scale_factor takes a position and a color as input, and
/// returns a scale factor for the given color. We have to provide the
/// position in addition to the color, because the scale factor need not
-/// to be a constant: It can also be a function which should be applied to
+/// be a constant: It can also be a function which should be applied to
/// the position. For instance, in KBP vs K endgames, a scaling function
/// which checks for draws with rook pawns and wrong-colored bishops.
using namespace std;
-/// Version number. If Version is left empty, then compile date, in the
-/// format DD-MM-YY, is shown in engine_info.
+/// Version number. If Version is left empty, then compile date in the format
+/// DD-MM-YY and show in engine_info.
static const string Version = "";
/// Our fancy logging facility. The trick here is to replace cin.rdbuf() and
/// cout.rdbuf() with two Tie objects that tie cin and cout to a file stream. We
/// can toggle the logging of std::cout and std:cin at runtime whilst preserving
-/// usual i/o functionality and without changing a single line of code!
+/// usual i/o functionality, all without changing a single line of code!
/// Idea from http://groups.google.com/group/comp.lang.c++/msg/1d941c0f26ea0d81
struct Tie: public streambuf { // MSVC requires splitted streambuf for cin and cout
#include "movegen.h"
#include "position.h"
-/// Simple macro to wrap a very common while loop, no facny, no flexibility,
+/// Simple macro to wrap a very common while loop, no fancy, no flexibility,
/// hardcoded names 'mlist' and 'from'.
#define SERIALIZE(b) while (b) (mlist++)->move = make_move(from, pop_lsb(&b))
PieceType pt = type_of(pos.piece_on(from));
if (pt == PAWN)
- continue; // Will be generated togheter with direct checks
+ continue; // Will be generated together with direct checks
Bitboard b = pos.attacks_from(Piece(pt), from) & ~pos.pieces();
}
// Unary predicate used by std::partition to split positive scores from remaining
- // ones so to sort separately the two sets, and with the second sort delayed.
+ // ones so as to sort the two sets separately, with the second sort delayed.
inline bool has_positive_score(const ExtMove& ms) { return ms.score > 0; }
// Picks the best move in the range (begin, end) and moves it to the front.
/// Constructors of the MovePicker class. As arguments we pass information
-/// to help it to return the presumably good moves first, to decide which
+/// to help it to return the (presumably) good moves first, to decide which
/// moves to return (in the quiescence search, for instance, we only want to
-/// search captures, promotions and some checks) and about how important good
-/// move ordering is at the current node.
+/// search captures, promotions and some checks) and how important good move
+/// ordering is at the current node.
MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const HistoryStats& h,
Move* cm, Search::Stack* s) : pos(p), history(h), depth(d) {
/// next_move() is the most important method of the MovePicker class. It returns
/// a new pseudo legal move every time it is called, until there are no more moves
/// left. It picks the move with the biggest score from a list of generated moves
-/// taking care not returning the ttMove if has already been searched previously.
+/// taking care not returning the ttMove if it has already been searched previously.
template<>
Move MovePicker::next_move<false>() {
// Test for backward pawn.
// If the pawn is passed, isolated, or member of a pawn chain it cannot
// be backward. If there are friendly pawns behind on adjacent files
- // or if can capture an enemy pawn it cannot be backward either.
+ // or if it can capture an enemy pawn it cannot be backward either.
if ( (passed | isolated | chain)
|| (ourPawns & pawn_attack_span(Them, s))
|| (pos.attacks_from<PAWN>(s, Us) & theirPawns))
assert(opposed | passed | (pawn_attack_span(Us, s) & theirPawns));
- // A not passed pawn is a candidate to become passed, if it is free to
+ // A not-passed pawn is a candidate to become passed, if it is free to
// advance and if the number of friendly pawns beside or behind this
- // pawn on adjacent files is higher or equal than the number of
+ // pawn on adjacent files is higher than or equal to the number of
// enemy pawns in the forward direction on the adjacent files.
candidate = !(opposed | passed | backward | isolated)
&& (b = pawn_attack_span(Them, s + pawn_push(Us)) & ourPawns) != 0
namespace Pawns {
/// Pawns::Entry contains various information about a pawn structure. Currently,
-/// it only includes a middle game and end game pawn structure evaluation, and a
+/// it only includes a middlegame and endgame pawn structure evaluation, and a
/// bitboard of passed pawns. We may want to add further information in the future.
/// A lookup to the pawn hash table (performed by calling the probe function)
/// returns a pointer to an Entry object.
if (promotion_type(m) - 2 != NO_PIECE_TYPE)
return false;
- // If the from square is not occupied by a piece belonging to the side to
+ // If the 'from' square is not occupied by a piece belonging to the side to
// move, the move is obviously not legal.
if (pc == NO_PIECE || color_of(pc) != us)
return false;
if (!((between_bb(lsb(checkers()), king_square(us)) | checkers()) & to))
return false;
}
- // In case of king moves under check we have to remove king so to catch
- // as invalid moves like b1a1 when opposite queen is on c1.
+ // In case of king moves under check we have to remove king so as to catch
+ // invalid moves like b1a1 when opposite queen is on c1.
else if (attackers_to(to, pieces() ^ from) & pieces(~us))
return false;
}
Square to = to_sq(m);
PieceType pt = type_of(piece_on(from));
- // Is there a direct check ?
+ // Is there a direct check?
if (ci.checkSq[pt] & to)
return true;
- // Is there a discovered check ?
+ // Is there a discovered check?
if ( unlikely(ci.dcCandidates)
&& (ci.dcCandidates & from)
&& !aligned(from, to, king_square(~sideToMove)))
return true;
- // Can we skip the ugly special cases ?
+ // Can we skip the ugly special cases?
if (type_of(m) == NORMAL)
return false;
case PROMOTION:
return attacks_bb(Piece(promotion_type(m)), to, pieces() ^ from) & ksq;
- // En passant capture with check ? We have already handled the case
+ // En passant capture with check? We have already handled the case
// of direct checks and ordinary discovered check, so the only case we
// need to handle is the unusual case of a discovered check through
// the captured pawn.
++nodes;
Key k = st->key;
- // Copy some fields of old state to our new StateInfo object except the ones
- // which are going to be recalculated from scratch anyway, then switch our state
- // pointer to point to the new (ready to be updated) state.
+ // Copy some fields of the old state to our new StateInfo object except the
+ // ones which are going to be recalculated from scratch anyway and then switch
+ // our state pointer to point to the new (ready to be updated) state.
std::memcpy(&newSt, st, StateCopySize64 * sizeof(uint64_t));
newSt.previous = st;
// Update side to move
k ^= Zobrist::side;
- // Increment ply counters.In particular rule50 will be reset to zero later on
+ // Increment ply counters. In particular, rule50 will be reset to zero later on
// in case of a capture or a pawn move.
++gamePly;
++st->rule50;
} while (stmAttackers);
// If we are doing asymmetric SEE evaluation and the same side does the first
- // and the last capture, he loses a tempo and gain must be at least worth
+ // and the last capture, it loses a tempo and gain must be at least worth
// 'asymmThreshold', otherwise we replace the score with a very low value,
// before negamaxing.
if (asymmThreshold)
}
-/// Position::compute_psq_score() computes the incremental scores for the middle
-/// game and the endgame. These functions are used to initialize the incremental
-/// scores when a new position is set up, and to verify that the scores are correctly
+/// Position::compute_psq_score() computes the incremental scores for the middlegame
+/// and the endgame. These functions are used to initialize the incremental scores
+/// when a new position is set up, and to verify that the scores are correctly
/// updated by do_move and undo_move when the program is running in debug mode.
Score Position::compute_psq_score() const {
}
-/// Position::compute_non_pawn_material() computes the total non-pawn middle
-/// game material value for the given side. Material values are updated
-/// incrementally during the search. This function is only used when
-/// initializing a new Position object.
+/// Position::compute_non_pawn_material() computes the total non-pawn middlegame
+/// material value for the given side. Material values are updated incrementally
+/// during the search. This function is only used when initializing a new Position
+/// object.
Value Position::compute_non_pawn_material(Color c) const {
/// PSQT[PieceType][Square] contains Piece-Square scores. For each piece type on
-/// a given square a (midgame, endgame) score pair is assigned. PSQT is defined
+/// a given square a (middlegame, endgame) score pair is assigned. PSQT is defined
/// for the white side and the tables are symmetric for the black side.
static const Score PSQT[][SQUARE_NB] = {
<< std::endl;
}
- // Reset the threads, still sleeping: will be wake up at split time
+ // Reset the threads, still sleeping: will wake up at split time
for (size_t i = 0; i < Threads.size(); ++i)
Threads[i]->maxPly = 0;
// Bring the best move to the front. It is critical that sorting
// is done with a stable algorithm because all the values but the
// first and eventually the new best one are set to -VALUE_INFINITE
- // and we want to keep the same order for all the moves but the new
- // PV that goes to the front. Note that in case of MultiPV search
- // the already searched PV lines are preserved.
+ // and we want to keep the same order for all the moves except the
+ // new PV that goes to the front. Note that in case of MultiPV
+ // search the already searched PV lines are preserved.
std::stable_sort(RootMoves.begin() + PVIdx, RootMoves.end());
// Write PV back to transposition table in case the relevant
continue;
// At root obey the "searchmoves" option and skip moves not listed in Root
- // Move List, as a consequence any illegal move is also skipped. In MultiPV
+ // Move List. As a consequence any illegal move is also skipped. In MultiPV
// mode we also skip PV moves which have been already searched.
if (RootNode && !std::count(RootMoves.begin() + PVIdx, RootMoves.end(), move))
continue;
// Step 14. Make the move
pos.do_move(move, st, ci, givesCheck);
- // Step 15. Reduced depth search (LMR). If the move fails high will be
+ // Step 15. Reduced depth search (LMR). If the move fails high it will be
// re-searched at full depth.
if ( depth >= 3 * ONE_PLY
&& !pvMove
Bitboard xray = (attacks_bb< ROOK>(m2to, occ) & pos.pieces(color_of(pc), QUEEN, ROOK))
| (attacks_bb<BISHOP>(m2to, occ) & pos.pieces(color_of(pc), QUEEN, BISHOP));
- // Verify attackers are triggered by our move and not already exist
+ // Verify attackers are triggered by our move and not already existing
if (unlikely(xray) && (xray & ~pos.attacks_from<QUEEN>(m2to)))
return true;
}
/// The LimitsType struct stores information sent by GUI about available time
/// to search the current move, maximum depth/time, if we are in analysis mode
-/// or if we have to ponder while is our opponent's side to move.
+/// or if we have to ponder while it's our opponent's turn to move.
struct LimitsType {
// TimerThread::idle_loop() is where the timer thread waits msec milliseconds
-// and then calls check_time(). If msec is 0 thread sleeps until is woken up.
+// and then calls check_time(). If msec is 0 thread sleeps until it's woken up.
extern void check_time();
void TimerThread::idle_loop() {
if (searching)
return false;
- // Make a local copy to be sure doesn't become zero under our feet while
+ // Make a local copy to be sure it doesn't become zero under our feet while
// testing next condition and so leading to an out of bounds access.
int size = splitPointsSize;
};
-/// The Score enum stores a midgame and an endgame value in a single integer
+/// The Score enum stores a middlegame and an endgame value in a single integer
/// (enum). The least significant 16 bits are used to store the endgame value
-/// and the upper 16 bits are used to store the midgame value. The compiler is
-/// free to choose the enum type as long as it can store the data, so we
+/// and the upper 16 bits are used to store the middlegame value. The compiler
+/// is free to choose the enum type as long as it can store the data, so we
/// ensure that Score is an integer type by assigning some big int values.
enum Score {
SCORE_ZERO,
namespace {
// position() is called when engine receives the "position" UCI command.
- // The function sets up the position described in the given fen string ("fen")
+ // The function sets up the position described in the given FEN string ("fen")
// or the starting position ("startpos") and then makes the moves given in the
// following move list ("moves").