]> git.sesse.net Git - stockfish/commitdiff
Even more spelling fixes
authorArjun Temurnikar <arjuntemurnikano@gmail.com>
Thu, 5 Dec 2013 06:18:12 +0000 (07:18 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 6 Dec 2013 08:03:24 +0000 (09:03 +0100)
No functional change.

18 files changed:
src/bitcount.h
src/book.cpp
src/endgame.cpp
src/endgame.h
src/evaluate.cpp
src/material.h
src/misc.cpp
src/movegen.cpp
src/movepick.cpp
src/pawns.cpp
src/pawns.h
src/position.cpp
src/psqtab.h
src/search.cpp
src/search.h
src/thread.cpp
src/types.h
src/uci.cpp

index a92ad75feb2a60f9aba890a161443f5339c97319..8dfd7d18790ea59f8254faabd0019c3e7a77db32 100644 (file)
@@ -33,7 +33,7 @@ enum BitCountType {
 };
 
 /// 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;
index e523bf4a18419f4bd9a1da9b2e6ec8293b84c174..8fecffae743d6e8c2669bb8e78dfca2f4404e29d 100644 (file)
@@ -35,8 +35,8 @@ using namespace std;
 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;
@@ -410,9 +410,9 @@ Move PolyglotBook::probe(const Position& pos, const string& fName, bool pickBest
       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);
index 976b3d6365c46d4316784bb3ea078af54924e0b7..0ee0a6eb840bf2b0eabe740b0d1faf13d50e4ee5 100644 (file)
@@ -80,10 +80,10 @@ namespace {
     return sq;
   }
 
-  // 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 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);
@@ -187,8 +187,8 @@ Value Endgame<KBNK>::operator()(const Position& pos) const {
   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))
   {
@@ -286,7 +286,7 @@ Value Endgame<KRKB>::operator()(const Position& pos) const {
 }
 
 
-/// 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 {
@@ -328,9 +328,8 @@ Value Endgame<KQKP>::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 {
 
@@ -349,7 +348,7 @@ 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
 
@@ -377,7 +376,7 @@ template<> Value Endgame<KNNK>::operator()(const Position&) const { return VALUE
 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.
@@ -419,7 +418,7 @@ ScaleFactor Endgame<KBPsK>::operator()(const Position& pos) const {
       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)))
@@ -445,8 +444,8 @@ ScaleFactor Endgame<KBPsK>::operator()(const Position& pos) const {
 }
 
 
-/// 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 {
 
@@ -469,9 +468,9 @@ 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.
@@ -556,7 +555,7 @@ ScaleFactor Endgame<KRPKR>::operator()(const Position& pos) const {
                          - 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)
   {
@@ -613,9 +612,8 @@ ScaleFactor Endgame<KRPKB>::operator()(const Position& pos) const {
   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 {
 
@@ -662,8 +660,8 @@ ScaleFactor Endgame<KPsK>::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)
@@ -673,10 +671,10 @@ ScaleFactor Endgame<KPsK>::operator()(const Position& pos) const {
 }
 
 
-/// 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 {
 
@@ -726,8 +724,7 @@ 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 {
 
@@ -796,9 +793,9 @@ 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 {
 
@@ -819,9 +816,8 @@ 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 {
 
@@ -839,8 +835,8 @@ 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 {
 
@@ -857,11 +853,11 @@ 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 {
 
index 394a6f62ae06c8e01d949338b31c14f02ce4bec7..627492937ede4135e9c37997af169a558a465fff 100644 (file)
@@ -49,12 +49,12 @@ enum EndgameType {
   // 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
index 15fce527e902b26749a41accaaa6b406ebe9a7ab..7d57dddbe6e62a4701a8bc3c461ad6e84e2056e4 100644 (file)
@@ -185,8 +185,8 @@ namespace {
   // 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[] = {
@@ -195,9 +195,9 @@ namespace {
   };
 
   // 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 };
@@ -261,7 +261,7 @@ namespace {
 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) {
@@ -362,14 +362,14 @@ Value do_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);
 
@@ -380,7 +380,7 @@ Value do_evaluate(const Position& pos) {
       && 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)
       {
@@ -458,7 +458,7 @@ Value do_evaluate(const Position& pos) {
     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)
@@ -891,7 +891,7 @@ Value do_evaluate(const Position& pos) {
     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]);
   }
 
@@ -943,7 +943,7 @@ Value do_evaluate(const Position& pos) {
   }
 
 
-  // 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) {
index cbf6e5550e2b6b1ca55fcd0784ef7074920576cf..b68c4ef12bfc38ed444cee1309efa3afbd758a8e 100644 (file)
@@ -62,7 +62,7 @@ Phase game_phase(const Position& pos);
 /// 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.
 
index 08cbc919807dfa0e4d6d0308634e0841edfa2c7a..efa57a581acf1ebf96d146d202e126b2e2f5b077 100644 (file)
@@ -26,8 +26,8 @@
 
 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 = "";
 
 
@@ -82,7 +82,7 @@ void dbg_print() {
 /// 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
index f1eb4b1d16bef0d3a8b1d5c6e2878e26d223e6c9..5f4bc58707c8489270b73e2be4c0f6edbdafcb23 100644 (file)
@@ -22,7 +22,7 @@
 #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))
 
@@ -325,7 +325,7 @@ ExtMove* generate<QUIET_CHECKS>(const Position& pos, ExtMove* mlist) {
      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();
 
index e2ae7d9591712dd5eabec2d767b72311843e0fd3..2a090b1b30c38640f0fe2d656d85ecf851fea14e 100644 (file)
@@ -50,7 +50,7 @@ namespace {
   }
 
   // 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.
@@ -65,10 +65,10 @@ namespace {
 
 
 /// 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) {
@@ -286,7 +286,7 @@ void MovePicker::generate_next() {
 /// 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>() {
 
index 04ae01530e44c7611680fa0d2f05a16dd810221e..37db673f2ff2ede1b03e62808ce3db223d7f29c5 100644 (file)
@@ -124,7 +124,7 @@ namespace {
         // 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))
@@ -145,9 +145,9 @@ namespace {
 
         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
index 0099ec209d736184cc43186f22632783a4f289c9..fed90b703bd2901fd56acf476ff9907627c342a0 100644 (file)
@@ -27,7 +27,7 @@
 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.
index 3b59b24a19171190c1d7d62acd93e6faeaf11968..982befa35dacf71960f2d1bea539c7eccd2eb297 100644 (file)
@@ -515,7 +515,7 @@ bool Position::pseudo_legal(const Move m) const {
   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;
@@ -604,8 +604,8 @@ bool Position::pseudo_legal(const Move m) const {
           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;
   }
@@ -626,17 +626,17 @@ bool Position::gives_check(Move m, const CheckInfo& ci) const {
   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;
 
@@ -648,7 +648,7 @@ bool Position::gives_check(Move m, const CheckInfo& ci) const {
   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.
@@ -695,9 +695,9 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
   ++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;
@@ -706,7 +706,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
   // 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;
@@ -1097,7 +1097,7 @@ int Position::see(Move m, int asymmThreshold) const {
   } 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)
@@ -1193,9 +1193,9 @@ Key Position::compute_material_key() const {
 }
 
 
-/// 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 {
@@ -1213,10 +1213,10 @@ 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 {
 
index 2363826e5dc0f0f1ee58e6cfe6f463477c115788..1859428074a86d4d3a63954e38c48a16ae833ed9 100644 (file)
@@ -26,7 +26,7 @@
 
 
 /// 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] = {
index b8b325e57202f885ee24ee727f35fb11d59d1898..6aa1081f435e0cd666dc8ba3ba0dfcfdc2ebb245 100644 (file)
@@ -229,7 +229,7 @@ void Search::think() {
           << 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;
 
@@ -348,9 +348,9 @@ namespace {
                 // 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
@@ -776,7 +776,7 @@ moves_loop: // When in check and at SpNode search starts from here
           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;
@@ -907,7 +907,7 @@ moves_loop: // When in check and at SpNode search starts from here
       // 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
@@ -1401,7 +1401,7 @@ moves_loop: // When in check and at SpNode search starts from here
         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;
     }
index 74217fe3c75f5e670ebdb7cce662524ab4d812ea..b8858527515736f06dac88baa1676167d42339f3 100644 (file)
@@ -73,7 +73,7 @@ struct RootMove {
 
 /// 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 {
 
index e495dc0300403bb43353b6c4bcf07a95aede7550..7966499d7e60dd8fffc9260ce85a1a918985e265 100644 (file)
@@ -91,7 +91,7 @@ Thread::Thread() /* : splitPoints() */ { // Value-initialization bug in MSVC
 
 
 // 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() {
@@ -169,7 +169,7 @@ bool Thread::available_to(const Thread* master) const {
   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;
 
index 94c291f6b5383bd9400e48471f1a1b8c70eb82e4..581dc768274e22b5b5c1feadf58bbd1f5916c503 100644 (file)
@@ -236,10 +236,10 @@ enum Rank {
 };
 
 
-/// 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,
index 4dbce035fd38c56023f3dbe5fe0ca97a706eda37..6aea40682d98b499f36916e712718a2c5c78483c 100644 (file)
@@ -129,7 +129,7 @@ void UCI::loop(const string& args) {
 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").